Project

Profile

Help

Is there any way to set https://www.saxonica.com/html/documentation10/javadoc/net/sf/saxon/s9api/UnprefixedElementMatchingPolicy.html#ANY_NAMESPACE for an XPathCompiler?

Added by Martin Honnen over 3 years ago

For XSLT, Saxon 10 allow settings setUnprefixedElementMatchingPolicy to https://www.saxonica.com/html/documentation10/javadoc/net/sf/saxon/s9api/UnprefixedElementMatchingPolicy.html#ANY_NAMESPACE. Is there any way to do the same for the XPathCompiler or XQueryCompiler?


Replies (2)

RE: Is there any way to set https://www.saxonica.com/html/documentation10/javadoc/net/sf/saxon/s9api/UnprefixedElementMatchingPolicy.html#ANY_NAMESPACE for an XPathCompiler? - Added by Martin Honnen over 3 years ago

I am able to do it with the net.sf.saxon.sxpath by doing e.g.

       XPathEvaluator xpathEvaluator = new XPathEvaluator(processor.getUnderlyingConfiguration());

        IndependentContext independentContext = new IndependentContext();
        independentContext.setUnprefixedElementMatchingPolicy(UnprefixedElementMatchingPolicy.ANY_NAMESPACE);

        xpathEvaluator.setStaticContext(independentContext);

I don't find a way to do it with s9api, however.

    (1-2/2)

    Please register to reply