Re: [xsl] A Problem with Variables and Xpath

Subject: Re: [xsl] A Problem with Variables and Xpath
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Mon, 25 Jul 2011 17:20:37 +0200
Christian.Sisti@xxxxxxxxxxx wrote:
Hi All!

It is possible to gather the value of an attribute using variable in
Xpath? How?

I have a variable like this:

<xsl:variable name="foo">something</xsl:variable>

and I am trying to set an attribute in this way:

<disney>
   <xsl:attribute name="mickey">
    <xsl:value-of select="./$foo"/>
   </xsl:attribute>
</disney>

where $foo is the name of an attribute of the source document.

Then you want <xsl:value-of select="@*[local-name() = $foo]"/>


--


	Martin Honnen --- MVP Data Platform Development
	http://msmvps.com/blogs/martin_honnen/

Current Thread