XSL HOWDOI use attribute of current node to select a different node?

C

CB

I know I can select a node by attribute value using something like

<xsl:apply-templates select="//*[@Name='Joe']"/>

How can I replace Joe with an attribute from the current node? I.e.,
the current node has an attribute Manager="Fred". I want a select
expression something like

"//*[@Name='"<xsl:value-of select="@Manager"/>"']"

This gives me the text I want, but I can't figure out how to embed it
into the xsl:apply-templates' select. I.e., the following won't work;

<xsl:apply-templates select="//*[@Name='"<xsl:value-of
select="@Manager"/>"']"/>

I assume it's a notational nuance I don't know yet, but which will be
immediately obvious once someone shows me what it is.

Thanks.
 
J

Johannes Koch

CB said:
I know I can select a node by attribute value using something like

<xsl:apply-templates select="//*[@Name='Joe']"/>

How can I replace Joe with an attribute from the current node? I.e.,
the current node has an attribute Manager="Fred".

Use current()/@Manager instead of 'Joe'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,042
Latest member
icassiem

Latest Threads

Top