This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: How to specify a path to a node in a nodeset using a variable
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] How to specify a path to a node in a nodeset using a variable
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Thu, 8 Mar 2001 16:58:38 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
> I have the following scenario
>
> INPUT.XML
> <document>
> <group>
> <row>
> <label>User Id:</label>
> <entryfield name="/Person/UserId/@name"/> <!--
> <xsl:variable name="path" select="string(@name)"/>
> <xsl:value-of select="$container/$path"/>
Inventive, but it doesn't work. Variables can only hold values, they can't
hold expressions or parts of expressions.
Saxon (and I think several other products, now) has an evaluate() extension
function that will do this for you.
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list