/** Constructs a "test" for type alternatives */ public Test(XPath20 xpath, XSTypeAlternativeImpl typeAlternative, NamespaceSupport namespaceContext) { fXPath = xpath; fExpression = xpath == null ? "" : xpath.getXPathStrValue(); fXPathPsychoPath = null; fTypeAlternative = typeAlternative; fXPath2NamespaceContext = namespaceContext; }
/** Evaluate the test expression with respect to the specified element and its attributes */ public boolean evaluateTest(QName element, XMLAttributes attributes, NamespaceContext instanceNamespaceContext, String expandedSystemId) { if (fXPath != null) { return fXPath.evaluateTest(element, attributes); } else if (fXPathPsychoPath != null) { return evaluateTestWithPsychoPathXPathEngine(element, attributes, instanceNamespaceContext, expandedSystemId); } else { return false; } }
testExpr = new Test(new XPath20(testStr, fSymbolTable, new NamespaceSupport(schemaDoc.fNamespaceSupport)), typeAlternative, new NamespaceSupport(schemaDoc.fNamespaceSupport));