Coker, Jonathan M 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.
I cannot reproduce your problem. When I use the SimpleXPathAPI sample
application and use your source file, I get the expected result. What
version of Xalan-C are you using?
Dave