Subject: Using name in Xpath
From: "Harbaugh, Alan (Bank One)" <Alan_Harbaugh@xxxxxxxxxxx>
Date: Thu, 23 May 2002 12:17:33 -0400
|
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@xxxxxxxxxxxxx</reply_to>
</Location1>
<Location2>
<reply_to>support@xxxxxxxxxxxxx</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
|