Hi Coker,

I tried to reproduce your problem on my end, but am getting the correct
output with the sample SimpleXPathAPI being included with the Xalan package,
absolutely no problem, its working fine.

- Amish.

On 3/1/07, Coker, Jonathan M <[EMAIL PROTECTED]> wrote:

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