This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Using a variable to get the value of an element
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 28 Jan 2002 10:03:16 -0000
- Subject: RE: [xsl] Using a variable to get the value of an element
- Reply-to: xsl-list at lists dot mulberrytech dot com
> I need the value of an element, but the name of that element is stored
> in a variable - see below:
>
> Where I say <xsl:apply-templates select="$hello" /> I
> actually want the
> value of the element whose name is stored in the variable
> hello, not the
> value of the variable.
Try:
<xsl:apply-templates select="*[name()=$hello]"/>
But remember that this will match on the QName of the element, not its
expanded name, i.e. you will have problems if different prefixes are used
for the same namespace.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list