This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using name in Xpath


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]