commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LANTRES Franck" <franck.lant...@fr.renault-sport-f1.com>
Subject [JXPATH] - misunderstood XPath response
Date Fri, 30 Jan 2004 09:21:52 GMT
Hi,

I request a XML document which could be something like that :
<ROOT>
  <FOO>
    <NAME>my_name</NAME>
    <ID>my_id</ID>
  </FOO>
  <FOO>
    <NAME>your_name</NAME>
    <ID>your_id</ID>
  </FOO>
</ROOT>


As I would like to get a particular FOO, I use the following XPath query
:
document/ROOT/FOO[NAME='my_name']
The XML I expect is
<FOO>
  <NAME>my_name</NAME>
  <ID>my_id</ID>
</FOO>

But I get :
  <FOO>
    <NAME>my_name</NAME>
    <ID>my_id</ID>
  </FOO>
  <FOO>
    <NAME>your_name</NAME>
    <ID>your_id</ID>
  </FOO>

If I use the query document/ROOT/FOO[NAME='my_name']/*, I get the nodes
I expect but without the FOO one, ie :
  <NAME>my_name</NAME>
  <ID>my_id</ID>


Where is the problem/bug ?

Thanks for your help.

Franck.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message