Project

Profile

Help

Bug #2711

closed

UnsupportedOperationException when compiling XPath with JAXP NamespaceContext

Added by Gunther Rademacher over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
JAXP Java API
Sprint/Milestone:
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

XPathCompile.java (1.59 KB) XPathCompile.java reproduction of 9.7 UnsupportedOperationException Gunther Rademacher, 2016-04-14 15:38

Please register to edit this issue

Also available in: Atom PDF