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

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


     */
    protected DynamicContext initDynamicContext(XSModel schema,
                                                Document document,
                                                Map psychoPathParams) {
       
        fDynamicContext = new DefaultDynamicContext(schema, document);       
       
        // populate the 'PsychoPath XPath 2' static context, with namespace
        // bindings derived from the XML Schema document.
        NamespaceSupport xpath2NamespaceContext = (NamespaceSupport)
                                    psychoPathParams.get("XPATH2_NS_CONTEXT");
View Full Code Here


     */
    protected DynamicContext initDynamicContext(XSModel schema,
                                                Document document,
                                                Map psychoPathParams) {
       
        fDynamicContext = new DefaultDynamicContext(schema, document);       
       
        // populate the PsychoPath XPath 2.0 static context, with namespace
        // bindings derived from the XSD Schema document.
        NamespaceSupport xpath2NamespaceContext = (NamespaceSupport)
                                    psychoPathParams.get("XPATH2_NS_CONTEXT");
View Full Code Here

        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
           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;
View Full Code Here

        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
           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;
View Full Code Here

                                          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
           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;
View Full Code Here

                                 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
           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;
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

      
        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

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.