|
|
Re: Xalan C / XPath question: msg#00006
|
Subject: |
Re: Xalan C / XPath question |
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 <jonathan.m.coker@xxxxxxxxxx> 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/Name[@ID=1]/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
|
| |