So ive been given an assignment in my university of "fixing" XPath and get it to return the nodes in the correct order.
Ive been trying to find a way around writing a very long code and breaking each expression into little peaces and putting it back together again.
Ive thought of a few ideas but i need help making them happen :)
Find the method in the XPath jar that sorts the nodes and delete it - problem is i dont know if its possible to see the XPath jar code , and didnt find it online.- if you can point me to it , that would be great !
Ive found this option which looks like it should do the trick http://cafeconleche.org/books/xmljava/chapters/ch16s06.html
but it demands dom implementation of XPath 3.0 and i cant find that dom anywhere - any idea if there is such thing ?If you have any other idea i would love to hear !
For example : for this xml
<library>
<book name="book1">
hello
</book>
<book name="book2">
world
</book>
<book name="book3">
!!!
</book>
</library>
and this expression : /library/book[3]/preceding-sibling::book Im getting
book1 book2
insted of :
book2 book1
I can use anything as long as i do it in a java program
Thank you for all your help :)