> Upon learning that //someelement does not guarantee the order that things > come back in are document order, I have switched tacts and decided to try to > handle it my self. I was thinking about playing around with the position() > function, but cannot get Jaxen to return the position of an element to me. > I have tried > //someelement[@id='S55']/position() but that returns 0 in all cases
Sorting elements by their position within their parent node will not guarantee document order in any case, so you will have to switch tactics even further. Imagine this: <A> <X> <C>foo</C> </X> <X> <B>bar</B> </X> </A> and this path: "//B | //C" Both the B and C element have position 1 with respect to their parent.. so you have to traverse the whole tree to establish document order post-hoc. It's much cheaper to hack it into Jaxen, but I would protest if it was turned on by default, because it ruins performance. What I found worrying however, is that Jaxen doesn't throw an exception with the path you tried :) Christian _______________________________________________ Jaxen-interest mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jaxen-interest