diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/rule/SaxonDomXPathQuery.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/rule/SaxonDomXPathQuery.java index 68771d2381..348f99bc57 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/rule/SaxonDomXPathQuery.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/rule/SaxonDomXPathQuery.java @@ -31,10 +31,10 @@ import net.sourceforge.pmd.util.DataMap.SimpleDataKey; import net.sf.saxon.Configuration; import net.sf.saxon.dom.DocumentWrapper; import net.sf.saxon.lib.ExtensionFunctionDefinition; -import net.sf.saxon.lib.NamespaceConstant; import net.sf.saxon.om.AtomicSequence; import net.sf.saxon.om.Item; import net.sf.saxon.om.NamePool; +import net.sf.saxon.om.NamespaceUri; import net.sf.saxon.om.StructuredQName; import net.sf.saxon.sxpath.IndependentContext; import net.sf.saxon.sxpath.XPathDynamicContext; @@ -74,16 +74,13 @@ final class SaxonDomXPathQuery { private XPathExpressionWithProperties makeXPathExpression(String xpath, String defaultUri, List> properties) { final IndependentContext xpathStaticContext = new IndependentContext(configuration); - xpathStaticContext.declareNamespace("fn", NamespaceConstant.FN); - xpathStaticContext.setDefaultElementNamespace(defaultUri); - - - + xpathStaticContext.declareNamespace("fn", NamespaceUri.FN); + xpathStaticContext.setDefaultElementNamespace(NamespaceUri.of(defaultUri)); for (XPathFunctionDefinition xpathFun : xpathHandler.getRegisteredExtensionFunctions()) { ExtensionFunctionDefinition fun = new SaxonExtensionFunctionDefinitionAdapter(xpathFun); StructuredQName qname = fun.getFunctionQName(); - xpathStaticContext.declareNamespace(qname.getPrefix(), qname.getURI()); + xpathStaticContext.declareNamespace(qname.getPrefix(), qname.getNamespaceUri()); this.configuration.registerExtensionFunction(fun); }