// Load an XPath factory. This should load the Saxon schema-aware factory if everything has
// been configured correctly.
//XPathFactory xpf = XPathFactory.newInstance(NamespaceConstant.OBJECT_MODEL_SAXON);
XPathFactory xpf = new EnterpriseXPathFactory();
XPath xpe = xpf.newXPath();
System.err.println("Loaded XPath Provider " + xpe.getClass().getName() +
" using factory " + xpf.getClass().getName());
// Request the processor to perform validation of input documents
xpf.setFeature("http://saxon.sf.net/feature/schema-validation", true);
// Check that the processor really is schema-aware
if (!xpf.getFeature("http://saxon.sf.net/feature/schema-validation")) {
System.err.println("Error: this XPath provider is not schema-aware (probably a license file problem)");
System.exit(2);
}
// Declare a variable resolver to return the value of variables used in XPath expressions