Is there any way to set https://www.saxonica.com/html/documentation10/javadoc/net/sf/saxon/s9api/UnprefixedElementMatchingPolicy.html#ANY_NAMESPACE for an XPathCompiler?
Replies (2)
Please register to reply
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
?
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.
I have added a method for Saxon 11.
Please register to reply