0

At present we perform XPath 2.0 queries (in Java) using:

// set earlier
XPathCompiler xPath;
XdmNode xmlDocument;

XPathExecutable exe = xPath.compile(query);
XPathSelector selector = exe.load();
selector.setContextItem(xmlDocument);
XdmValue nodeSet = selector.evaluate();

To use XPath 3.1, is it just update to Saxon 10 and the above is now XPath 3.1 (I think it does default to 3.1)? Or do I need to call it differently?

And if differently, is there an example somewhere on how to do this?

David Thielen
  • 28,723
  • 34
  • 119
  • 193

1 Answers1

0

That's right, just upgrade and you'll be using XPath 3.1 by default.

Saxon does have options to lower the language level (XPathCompiler.setLanguageVersion('2.0')) but there's very little point unless you're trying to pass conformance tests.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164