use of com.helger.schematron.saxon.SaxonNamespaceContext in project ph-schematron by phax.
the class PSXPathBoundSchema method _createXPathContext.
@Nonnull
private XPath _createXPathContext() {
final MapBasedNamespaceContext aNamespaceContext = getNamespaceContext();
final XPath aXPathContext = XPathHelper.createNewXPath(m_aXPathFactory, m_aXPathVariableResolver, m_aXPathFunctionResolver, aNamespaceContext);
if ("net.sf.saxon.xpath.XPathEvaluator".equals(aXPathContext.getClass().getName())) {
// Saxon implementation special handling
final XPathEvaluator aSaxonXPath = (XPathEvaluator) aXPathContext;
// Since 9.7.0-4 it must implement NamespaceResolver
aSaxonXPath.setNamespaceContext(new SaxonNamespaceContext(aNamespaceContext));
// Wrap the PSErrorHandler to a ErrorListener
aSaxonXPath.getConfiguration().setErrorListener(new PSErrorListener(getErrorHandler()));
}
return aXPathContext;
}
Aggregations