This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Using name in Xpath
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Harbaugh, Alan (Bank One)" <Alan_Harbaugh at bankone dot com>
- Cc: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 23 May 2002 17:32:33 +0100
- Subject: Re: [xsl] Using name in Xpath
- Organization: Jeni Tennison Consulting Ltd
- References: <F6223D58C0623E40B018A8F206C15A5A22431F@swilnts800.wil.fusa.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Alan,
> 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.
Yes, you're using it wrong. You have:
$emailData/data/[name()=$pSite]/reply_to
I think that you're trying to get the element child of the data
element whose name is the same as the value of the $pSite variable, in
which case you need:
$emailData/data/*[name()=$pSite]/reply_to
^
Predicates (expressions in []s) filter some set of nodes, which
implies that you need to select the nodes for them to filter ;)
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list