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 RE : [JXPATH] - misunderstood XPath response
Date Fri, 30 Jan 2004 16:59:20 GMT
Here is another problem I get from this morning :
I still use the same example.

If I use the "document/ROOT/FOO/ID" XPath query, I get two matches :
- the first contains <ID>my_id</ID><ID>your_id</ID>
- the second contains <ID>your_id</ID>

Note that I use pointers and the method context.iteratePointers.
I really don't understand how JXPath is working ......

Help !!!!

Franck.




> -----Message d'origine-----
> De : LANTRES Franck [mailto:franck.lantres@fr.renault-sport-f1.com] 
> Envoyé : vendredi 30 janvier 2004 10:22
> À : commons-user@jakarta.apache.org
> Objet : [JXPATH] - misunderstood XPath response
> 
> 
> 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
> 
> 


---------------------------------------------------------------------
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