Hi,

Try this:

/Game/Player/[EMAIL PROTECTED]'1']/text()  

BR,
Plamen

> -----Original Message-----
> From: Coker, Jonathan M [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 01, 2007 4:05 PM
> To: xalan-c-users@xml.apache.org
> Subject: Xalan C / XPath question
> 
> Hello,
>   I am pretty new to this so I hope someone can help me.  I am trying
> to
> access data using XPath and I am getting some confusing results.  The
> XML looks like this:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <Game Name="Game1">
>       <Player>
>               <Name  ID="1">Jonathan</Name>
>               <Weapon  Active="0">Gun</Weapon>
>         </Player>
>         <Player>
>                 <Name  ID="2">Sam</Name>
>                 <Weapon  Active="1">Sword</Weapon>
>       </Player>
> </Game>
> 
> Before I start posting code I will start simple.  If I put in an XPath
> expression like /Game/Player/Name/text()  I get back a nodeset with
> 'Jonathan' and 'Sam'.  If I put in /Game/Player/[EMAIL PROTECTED]/text()  I
> was expecting to get just 'Jonathan'.  However, I get a zero length
> nodeset.  Am I forming the XPath expression correctly (XMLSpy says
> parses it OK)?  Thank you for any help.
> 
> J

Reply via email to