Search in sources :

Example 6 with StaticContextBuilder

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);
}
Also used : StaticContextBuilder(org.eclipse.wst.xml.xpath2.processor.util.StaticContextBuilder) XSModel(org.apache.xerces.xs.XSModel) XercesTypeModel(org.eclipse.wst.xml.xpath2.processor.internal.types.xerces.XercesTypeModel) URL(java.net.URL)

Example 7 with StaticContextBuilder

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();
}
Also used : StaticContextBuilder(org.eclipse.wst.xml.xpath2.processor.util.StaticContextBuilder)

Aggregations

StaticContextBuilder (org.eclipse.wst.xml.xpath2.processor.util.StaticContextBuilder)5 Engine (org.eclipse.wst.xml.xpath2.processor.Engine)3 DynamicContextBuilder (org.eclipse.wst.xml.xpath2.processor.util.DynamicContextBuilder)3 XPath2Expression (org.eclipse.wst.xml.xpath2.api.XPath2Expression)2 XercesTypeModel (org.eclipse.wst.xml.xpath2.processor.internal.types.xerces.XercesTypeModel)2 InputStream (java.io.InputStream)1 URL (java.net.URL)1 DatatypeConfigurationException (javax.xml.datatype.DatatypeConfigurationException)1 OMFactory (org.apache.axiom.om.OMFactory)1 XSModel (org.apache.xerces.xs.XSModel)1 DynamicContext (org.eclipse.wst.xml.xpath2.api.DynamicContext)1 StaticContext (org.eclipse.wst.xml.xpath2.api.StaticContext)1 DefaultDynamicContext (org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext)1 JFlexCupParser (org.eclipse.wst.xml.xpath2.processor.JFlexCupParser)1 StaticChecker (org.eclipse.wst.xml.xpath2.processor.StaticChecker)1 StaticNameResolver (org.eclipse.wst.xml.xpath2.processor.StaticNameResolver)1 XPathParser (org.eclipse.wst.xml.xpath2.processor.XPathParser)1 XPath (org.eclipse.wst.xml.xpath2.processor.ast.XPath)1 FnFunctionLibrary (org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary)1 XSCtrLibrary (org.eclipse.wst.xml.xpath2.processor.function.XSCtrLibrary)1