I have a question about XPath2.0. I used xpath 1.0 in Java to get some information of a xml file. Nothing news. Some times I use an expression to
retrieve a nodelist : doc/entry/Number. So when I use the evaluate function with XPathConstants.NODESET it will return NodeList. Then i use a for loop
to iterate. But sometimes I want to use the sum function of XPath with the same evaluation function, but thats not possible beacuse it returns a NODESET and not a String what XPath use the sum function. So I read on the Internet and I thought meaby XPath 2.0 could help me because it can return sequences. I download the free libary of Saxon and use some examples to get it up and running. I couldn't get which example is the solution for me, all the examples except one look like a xpath1.0 implementation. So meaby ApplyXPathJAXP.java is what I need, but when I want to run this example the error message "Supplied node must be built using the same or a compatible Configuration" appear when the function "xpath.compile(xpathExpressionStr);" is executed.

I tried to solve the problem but it didn't make sense to me. So can someone tell me if XPath 2.0 is the solution for me?!. And how I can solve my problem if the is the right way ? I have to use it in Java 1.5 and not in XSLT.

Also I want to use more expressions in XPath.

Thanks for helping,