Search in sources :

Example 1 with XPathParser

use of org.eclipse.wst.xml.xpath2.processor.XPathParser in project webtools.sourceediting by eclipse.

the class XPath20Helper method compile.

public static void compile(String xpathExp) throws XPathExpressionException {
    try {
        XPathParser xpathParser = new JFlexCupParser();
        xpathParser.parse(xpathExp);
    } catch (XPathParserException ex) {
        throw new XPathExpressionException(ex.getMessage());
    }
}
Also used : XPathParserException(org.eclipse.wst.xml.xpath2.processor.XPathParserException) XPathParser(org.eclipse.wst.xml.xpath2.processor.XPathParser) XPathExpressionException(javax.xml.xpath.XPathExpressionException) JFlexCupParser(org.eclipse.wst.xml.xpath2.processor.JFlexCupParser)

Example 2 with XPathParser

use of org.eclipse.wst.xml.xpath2.processor.XPathParser in project webtools.sourceediting by eclipse.

the class AbstractPsychoPathWTPTest method compileXPath.

protected XPath compileXPath(DynamicContext dc, String xpath) throws XPathParserException, StaticError {
    XPathParser xpp = new JFlexCupParser();
    XPath path = xpp.parse(xpath);
    StaticChecker name_check = new StaticNameResolver(dc);
    name_check.check(path);
    return path;
}
Also used : XPath(org.eclipse.wst.xml.xpath2.processor.ast.XPath) StaticChecker(org.eclipse.wst.xml.xpath2.processor.StaticChecker) XPathParser(org.eclipse.wst.xml.xpath2.processor.XPathParser) StaticNameResolver(org.eclipse.wst.xml.xpath2.processor.StaticNameResolver) JFlexCupParser(org.eclipse.wst.xml.xpath2.processor.JFlexCupParser)

Example 3 with XPathParser

use of org.eclipse.wst.xml.xpath2.processor.XPathParser in project webtools.sourceediting by eclipse.

the class AbstractPsychoPathWTPTest method compileXPath.

protected XPath compileXPath(DynamicContext dc, String xpath, boolean isRootlessAccess) throws XPathParserException, StaticError {
    XPathParser xpp = new JFlexCupParser();
    XPath path = null;
    if (isRootlessAccess) {
        path = xpp.parse(xpath, isRootlessAccess);
    } else {
        path = xpp.parse(xpath);
    }
    StaticChecker name_check = new StaticNameResolver(dc);
    name_check.check(path);
    return path;
}
Also used : XPath(org.eclipse.wst.xml.xpath2.processor.ast.XPath) StaticChecker(org.eclipse.wst.xml.xpath2.processor.StaticChecker) XPathParser(org.eclipse.wst.xml.xpath2.processor.XPathParser) StaticNameResolver(org.eclipse.wst.xml.xpath2.processor.StaticNameResolver) JFlexCupParser(org.eclipse.wst.xml.xpath2.processor.JFlexCupParser)

Example 4 with XPathParser

use of org.eclipse.wst.xml.xpath2.processor.XPathParser in project webtools.sourceediting by eclipse.

the class AbstractPsychoPathTest method compileXPath.

protected XPath compileXPath(String xpath, boolean isRootlessAccess) throws XPathParserException, StaticError {
    XPathParser xpp = new JFlexCupParser();
    XPath path = null;
    if (isRootlessAccess) {
        path = xpp.parse(xpath, isRootlessAccess);
    } else {
        path = xpp.parse(xpath);
    }
    StaticChecker name_check = new StaticNameResolver(dynamicContext);
    name_check.check(path);
    return path;
}
Also used : XPath(org.eclipse.wst.xml.xpath2.processor.ast.XPath) StaticChecker(org.eclipse.wst.xml.xpath2.processor.StaticChecker) XPathParser(org.eclipse.wst.xml.xpath2.processor.XPathParser) StaticNameResolver(org.eclipse.wst.xml.xpath2.processor.StaticNameResolver) JFlexCupParser(org.eclipse.wst.xml.xpath2.processor.JFlexCupParser)

Example 5 with XPathParser

use of org.eclipse.wst.xml.xpath2.processor.XPathParser in project webtools.sourceediting by eclipse.

the class AbstractPsychoPathTest method compileXPath.

protected XPath compileXPath(String xpath) throws XPathParserException, StaticError {
    if (useNewApi) {
        newXPath = new Engine().parseExpression(xpath, staticContextBuilder);
        return null;
    } else {
        XPathParser xpp = new JFlexCupParser();
        XPath path = oldXPath = xpp.parse(xpath);
        StaticChecker name_check = new StaticNameResolver(dynamicContext);
        name_check.check(path);
        return path;
    }
}
Also used : XPath(org.eclipse.wst.xml.xpath2.processor.ast.XPath) StaticChecker(org.eclipse.wst.xml.xpath2.processor.StaticChecker) XPathParser(org.eclipse.wst.xml.xpath2.processor.XPathParser) StaticNameResolver(org.eclipse.wst.xml.xpath2.processor.StaticNameResolver) JFlexCupParser(org.eclipse.wst.xml.xpath2.processor.JFlexCupParser) Engine(org.eclipse.wst.xml.xpath2.processor.Engine)

Aggregations

JFlexCupParser (org.eclipse.wst.xml.xpath2.processor.JFlexCupParser)8 XPathParser (org.eclipse.wst.xml.xpath2.processor.XPathParser)8 StaticChecker (org.eclipse.wst.xml.xpath2.processor.StaticChecker)5 StaticNameResolver (org.eclipse.wst.xml.xpath2.processor.StaticNameResolver)5 XPath (org.eclipse.wst.xml.xpath2.processor.ast.XPath)5 XPathParserException (org.eclipse.wst.xml.xpath2.processor.XPathParserException)2 XPathExpressionException (javax.xml.xpath.XPathExpressionException)1 DefaultDynamicContext (org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext)1 DefaultEvaluator (org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator)1 Engine (org.eclipse.wst.xml.xpath2.processor.Engine)1 Evaluator (org.eclipse.wst.xml.xpath2.processor.Evaluator)1 ResultSequence (org.eclipse.wst.xml.xpath2.processor.ResultSequence)1 FnFunctionLibrary (org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary)1 DefaultStaticContext (org.eclipse.wst.xml.xpath2.processor.internal.DefaultStaticContext)1 XSDecimal (org.eclipse.wst.xml.xpath2.processor.internal.types.XSDecimal)1