This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Using name in Xpath
- From: "Harbaugh, Alan (Bank One)" <Alan_Harbaugh at bankone dot com>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 23 May 2002 12:17:33 -0400
- Subject: [xsl] Using name in Xpath
- Reply-to: xsl-list at lists dot mulberrytech dot com
Am I using name() incorrectly in the following xpath?
We are developing a Microsoft .Net application and the
processor is telling me it is an invalid xpath. Unfortunately,
I don't have much experience with their processor.
With a bunch of the non-relevant xsl taken out, this is what
I've got:
<xsl:variable name="emailData" select="document('emailData.xml')"/>
<xsl:template match="notification">
<xsl:variable name="pSite" select="site"/>
<SITE><xsl:value-of select="$pSite" /></SITE>
<REPLY_TO><xsl:value-of
select="$emailData/data/[name()=$pSite]/reply_to" />
</REPLY_TO>
Testing shows that the variable $pSite does get the expected value.
The emailData.xml file might look like:
<data>
<Location1>
<reply_to>support@location1.com</reply_to>
</Location1>
<Location2>
<reply_to>support@location2.com</reply_to>
</Location2>
</data>
Thanks for any help you can provide
Alan Harbaugh
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list