E
Eric Anderson
Suppose I have a variable which holds a tag name. I then want to be able
to select that tag name. How do I do that? For example:
<xsl:variable name="tag" select="'foo'"/>
<xsl:copy-of select="/ns:baz/ns:$tag"/>
This should copy the element /ns:baz/ns:foo. I have tried a couple of
ideas but none seem to work. Some that I have tried are:
<xsl:copy-of select="/ns:baz[name(current()) = concat('ns:', $tag)]"/>
and
<xsl:copy-of select="/ns:baz[name(*) = concat('ns:', $tag)]"/>
I pretty much understand why those didn't work, but I am not really sure
what will work. I assume it is something extremely simple and obvious
but I drawing a blank.
Thank you for any help you can provide.
Eric
to select that tag name. How do I do that? For example:
<xsl:variable name="tag" select="'foo'"/>
<xsl:copy-of select="/ns:baz/ns:$tag"/>
This should copy the element /ns:baz/ns:foo. I have tried a couple of
ideas but none seem to work. Some that I have tried are:
<xsl:copy-of select="/ns:baz[name(current()) = concat('ns:', $tag)]"/>
and
<xsl:copy-of select="/ns:baz[name(*) = concat('ns:', $tag)]"/>
I pretty much understand why those didn't work, but I am not really sure
what will work. I assume it is something extremely simple and obvious
but I drawing a blank.
Thank you for any help you can provide.
Eric