commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Plotnikov <dplot...@yahoo.com>
Subject Re: [jxpath] order of returned objects: //* vs. descendant::*
Date Fri, 09 May 2003 14:32:41 GMT
Joerg,

Thanks for reporting this. I will investigate.

- Dmitri


--- Joerg Heinicke <jheinicke@virbus.de> wrote:
> Hello,
> 
> for testing our own XPath implementation I wrote some XPath tests.
> Some of 
> the tests showed strange behaviour. The two XPathes I have in mind
> are '//*' 
> and 'descendant::*', both evaluated on the root context.
> 
> The order of the returned objects is different.
> 
> XML:
> 
> <element1>
>    <element1-1>
>      <element1-1-1/>
>      <element1-1-2/>
>    </element1-1>
>    <element1-2>
>      <element1-2-1/>
>      <element1-2-2/>
>    </element1-2>
>    <element1-3>
>      <element1-3-1/>
>      <element1-3-2/>
>    </element1-3>
> </element1>
> 
> result of '//*' (same for non-abbreviated syntax 
> '/descendant-or-self::node()/child::*'):
> 
> element1
> element1-1
> element1-2
> element1-3
> element1-1-1
> element1-1-2
> element1-2-1
> element1-2-2
> element1-3-1
> element1-3-2
> 
> result of 'descendant::*'
> 
> element1
> element1-1
> element1-1-1
> element1-1-2
> element1-2
> element1-2-1
> element1-2-2
> element1-3
> element1-3-1
> element1-3-2
> 
> The second order is the one I expect even if it's a node set and so
> has no 
> sorting (document order) or alphabetically sorted as I heard in
> JXPath.
> 
> What's really strange is the different behaviour of the two
> expressions.
> 
> Regards,
> 
> Joerg
> 
> -- 
> 
> System Development
> VIRBUS AG
> Fon  +49(0)341-979-7419
> Fax  +49(0)341-979-7409
> joerg.heinicke@virbus.de
> www.virbus.de
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

Mime
View raw message