Project

Profile

Help

(pure) XPath 4.0 support in Saxon EE 12?

Added by Martin Honnen about 1 year ago

For XQuery, the API documentation https://www.saxonica.com/html/documentation12/javadoc/net/sf/saxon/s9api/XQueryCompiler.html#setLanguageVersion(java.lang.String) documents that possible versions are "version - "3.1" or "4.0" in the current Saxon release.".

For XPath, the API documentation https://www.saxonica.com/html/documentation12/javadoc/net/sf/saxon/s9api/XPathCompiler.html#setLanguageVersion(java.lang.String) only mentions "value - One of the values 1.0, 2.0, 3.0, 3.05, 3.1.".

I take it from that documentation that pure XPath evaluation in Saxon 12 EE so far doesn't allow XPath 4.0 extensions/extension functions?


Replies (2)

RE: (pure) XPath 4.0 support in Saxon EE 12? - Added by Martin Honnen about 1 year ago

Now I have access to a system where I could try and indeed doing e.g.

        Processor processor = new Processor(true);

        XPathCompiler xpathCompiler = processor.newXPathCompiler();
        xpathCompiler.setLanguageVersion("4.0");

        XdmItem result = xpathCompiler.evaluateSingle("parse-html('<p id=p1>This is a test.<br>This is a test.<p>This is a test.')", null);

        System.out.println(result);

works fine (with 12.1 SaxonJ EE) if I add a dependency on e.g. nu.validator:htmlparser:1.4.6.

So it seems pure XPath 4.0 is already supported, just the documentation of setLanguageVersion needs to be updated to add "4.0" as a possible version string. And SaxonC might need a way to set the XPath version as well, at least I don't find a way to set it in the API https://www.saxonica.com/saxon-c/doc12/html/saxonc.html#PyXPathProcessor.

RE: (pure) XPath 4.0 support in Saxon EE 12? - Added by Debbie Lockett 12 months ago

Thanks for letting us know. I've added bug #5995 to fix the documentation.

Feature #5967 has already been raised and resolved for the SaxonC issue.

    (1-2/2)

    Please register to reply