Actions
Bug #2711
closedUnsupportedOperationException when compiling XPath with JAXP NamespaceContext
Start date:
2016-04-14
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
9.7
Fixed in Maintenance Release:
Platforms:
Description
While upgrading to Saxon-EE 9.7, I found that this code snippet now throws an UnsupportedOperationException:
XPath xpath = new XPathFactoryImpl().newXPath();
xpath.setNamespaceContext(namespaceContext);
xpath.compile("//*:x");
where namespaceContext is a javax.xml.namespace.NamespaceContext.
Here is a stack trace:
Exception in thread "main" java.lang.UnsupportedOperationException
at net.sf.saxon.xpath.JAXPXPathStaticContext.iteratePrefixes(JAXPXPathStaticContext.java:165)
at net.sf.saxon.expr.parser.RetainedStaticContext.<init>(RetainedStaticContext.java:85)
at net.sf.saxon.sxpath.AbstractStaticContext.makeRetainedStaticContext(AbstractStaticContext.java:109)
at net.sf.saxon.expr.parser.XPathParser.parse(XPathParser.java:472)
at net.sf.saxon.expr.parser.ExpressionTool.make(ExpressionTool.java:99)
at net.sf.saxon.xpath.XPathEvaluator.compile(XPathEvaluator.java:194)
A complete program reproducing this is attached.
Files
Please register to edit this issue
Actions