use of org.eclipse.wst.xml.xpath2.processor.util.StaticContextBuilder in project webtools.sourceediting by eclipse.
the class CompleteNewApiTest method testNamesWhichAreKeywords.
public void testNamesWhichAreKeywords() throws Exception {
// Bug 273719
bundle = Platform.getBundle("org.eclipse.wst.xml.xpath2.processor.tests");
URL fileURL = bundle.getEntry("/bugTestFiles/bug311480.xml");
loadDOMDocument(fileURL);
// Get XML Schema Information for the Document
XSModel schema = getGrammar();
// String xpath = "($input-context/atomic:root/atomic:integer) union ($input-context/atomic:root/atomic:integer)";
String xpath = "((/element/eq eq 'eq') or //child::xs:*) and false";
Boolean b = (Boolean) evaluateSimpleXPath(xpath, new StaticContextBuilder().withNamespace("xs", "urn:joe").withTypeModel(new XercesTypeModel(schema)), domDoc, Boolean.class);
assertEquals(Boolean.FALSE, b);
}
use of org.eclipse.wst.xml.xpath2.processor.util.StaticContextBuilder in project webtools.sourceediting by eclipse.
the class AbstractPsychoPathTest method setUp.
protected void setUp() throws Exception {
super.setUp();
bundle = Platform.getBundle("org.w3c.xqts.testsuite");
if (bundle == null) {
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
}
System.setProperty("javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema", "org.apache.xerces.jaxp.validation.XMLSchemaFactory");
staticContextBuilder = new StaticContextBuilder();
}
Aggregations