Package org.eclipse.wst.xml.xpath2.processor.function

Examples of org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary


    /*
     * Construct an PsychoPath XPath2 "result sequence", given a list of XDM items as input.
     */
    private ResultSequence getXPath2ResultSequence(List xdmItems) {
       
        ResultSequence xpath2Seq = ResultSequenceFactory.create_new();
       
        for (Iterator iter = xdmItems.iterator(); iter.hasNext(); ) {
            xpath2Seq.add((AnyType) iter.next());
        }
       
        return xpath2Seq;
       
    } // getXPath2ResultSequence
View Full Code Here


      
        Evaluator eval = null;
        if (contextNode != null) {
           eval = new DefaultEvaluator(fDynamicContext, domDoc);          
           // change focus to the top most element
           ResultSequence nodeEvalRS = ResultSequenceFactory.create_new();
           nodeEvalRS.add(new ElementType(contextNode,
                           fDynamicContext.node_position(contextNode)));
           if (xPathDefaultNamespace != null) {
             fDynamicContext.add_namespace(null, xPathDefaultNamespace)
           }
          
           fDynamicContext.set_focus(new Focus(nodeEvalRS));
        }
        else {
           eval = new DefaultEvaluator(fDynamicContext, null);  
        }
       
        ResultSequence rs = eval.evaluate(xp);

        boolean result = false;

        if (rs == null) {
           result = false;
        } else {
           if (rs.size() == 1) {
              AnyType rsReturn = rs.get(0);
              if (rsReturn instanceof XSBoolean) {
                 XSBoolean returnResultBool = (XSBoolean) rsReturn;
                 result = returnResultBool.value();
              } else {
                 result = false;
View Full Code Here

                                             String xPathDefaultNamespace,
                                             Element contextNode)
                                          throws StaticError, DynamicError,
                                          Exception {
       
        StaticChecker sc = new StaticNameResolver(fDynamicContext);
        sc.check(xp);
      
        Evaluator eval = null;
        if (contextNode != null) {
           eval = new DefaultEvaluator(fDynamicContext, domDoc);          
           // change focus to the top most element
View Full Code Here

    protected boolean evaluatePsychoPathExpr(XPath xp,
                                 String xPathDefaultNamespace,
                                 Element contextNode)
                                 throws StaticError, DynamicError {
       
        StaticChecker sc = new StaticNameResolver(fDynamicContext);
        sc.check(xp);
      
        Evaluator eval = null;
        if (contextNode != null) {
           eval = new DefaultEvaluator(fDynamicContext, domDoc);          
           // change focus to the top most element
View Full Code Here

                                             String xPathDefaultNamespace,
                                             Element contextNode)
                                          throws StaticError, DynamicError,
                                          Exception {
       
        StaticChecker sc = new StaticNameResolver(fDynamicContext);
        sc.check(xp);
      
        Evaluator eval = null;
        if (contextNode != null) {
           eval = new DefaultEvaluator(fDynamicContext, domDoc);          
           // change focus to the top most element
View Full Code Here

    protected boolean evaluatePsychoPathExpr(XPath xp,
                                 String xPathDefaultNamespace,
                                 Element contextNode)
                                 throws StaticError, DynamicError {
       
        StaticChecker sc = new StaticNameResolver(fDynamicContext);
        sc.check(xp);
      
        Evaluator eval = null;
        if (contextNode != null) {
           eval = new DefaultEvaluator(fDynamicContext, domDoc);          
           // change focus to the top most element
View Full Code Here

     * Compile an XPath string, and return the compiled XPath expression.
     */
    protected XPath compileXPathStr(String xpathStr,
                                    XSAssertImpl assertImpl,
                                    XSDHandler fSchemaHandler) {       
        XPathParser xpp = new JFlexCupParser();
        XPath xp = null;
       
        try {
            xp = xpp.parse("boolean(" + xpathStr + ")");
        } catch (XPathParserException ex) {
            // error compiling XPath expression
            reportError("cvc-xpath.3.13.4.2", assertImpl, fSchemaHandler);
       
       
View Full Code Here

                                       schemaDoc.fNamespaceSupport);
            }
            catch (XPathException e) {
               // fall back to full XPath 2.0 support, with PsychoPath engine
               try {
                  XPathParser xpp = new JFlexCupParser();
                  XPath xp = xpp.parse("boolean(" + test + ")");
                  testExpr = new Test(xp, typeAlternative, schemaDoc.fNamespaceSupport);
               } catch(XPathParserException ex) {
                  reportSchemaError("c-cta-xpath", new Object[] { test }, altElement);
                  //if the XPath is invalid, create a Test without an expression
                  testExpr = new Test((XPath20) null, typeAlternative,
View Full Code Here

     * Compile the XPath string, and return the compiled XPath expression.
     */
    protected XPath compileXPathStr(String xpathStr,
                                    XSAssertImpl assertImpl,
                                    XSDHandler fSchemaHandler) {       
        XPathParser xpp = new JFlexCupParser();
        XPath xp = null;
       
        try {
            xp = xpp.parse("boolean(" + xpathStr + ")");
        } catch (XPathParserException ex) {
            // error compiling XPath expression
            reportError("cvc-xpath.3.13.4.2", assertImpl, fSchemaHandler);
       
       
View Full Code Here

     */
    protected XPath compileXPathStr(String xpathStr,
                                    XSAssertImpl assertImpl,
                                    XSDHandler fSchemaHandler) {       
        XPathParser xpp = new JFlexCupParser();
        XPath xp = null;
       
        try {
            xp = xpp.parse("boolean(" + xpathStr + ")");
        } catch (XPathParserException ex) {
            // error compiling XPath expression
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.