Package org.apache.ode.bpel.compiler.v1.xpath20

Examples of org.apache.ode.bpel.compiler.v1.xpath20.JaxpFunctionResolver$CombineUrl


            String xquery = oxquery10.xquery.replaceFirst(
                    Constants.XQUERY_FUNCTION_HANDLER_COMPILER,
                    Constants.XQUERY_FUNCTION_HANDLER_RUNTIME);
            XQPreparedExpression exp = xqconn.prepareExpression(xquery);

            JaxpFunctionResolver funcResolver = new JaxpFunctionResolver(ctx,
                    oxquery10);
            JaxpVariableResolver variableResolver = new JaxpVariableResolver(ctx,
                    oxquery10, configuration);
            // Bind external variables to runtime values
            for (QName variable : exp.getAllUnboundExternalVariables()) {
View Full Code Here


     *
     * @return type
     */
    private static XPathFunction resolveFunction(XPathContext context,
        QName name) {
        JaxpFunctionResolver funcResolver = null;
        Item item = context.getCurrentIterator().current();

        if (item instanceof NodeWrapper) {
            Node node = (Node) ((NodeWrapper) item).getUnderlyingNode();

            if (node != null) {
                funcResolver = (JaxpFunctionResolver) node.getUserData(USER_DATA_KEY_FUNCTION_RESOLVER);
            }
        }

        return funcResolver.resolveFunction(name, 0);
    }
View Full Code Here

                    Constants.XQUERY_FUNCTION_HANDLER_RUNTIME);
            XQPreparedExpression exp = xqconn.prepareExpression(xquery);

            JaxpFunctionResolver funcResolver = new JaxpFunctionResolver(ctx,
                    oxquery10);
            JaxpVariableResolver variableResolver = new JaxpVariableResolver(ctx,
                    oxquery10, configuration);
            // Bind external variables to runtime values
            for (QName variable : exp.getAllUnboundExternalVariables()) {
              // Evaluate referenced variable
                Object value = variableResolver.resolveVariable(variable);
               
                // Figure out type of variable
                XQSequenceType xqType = getItemType(xqconn, value);
               
                // Saxon doesn't like binding sequences to variables
View Full Code Here

    /**
     * @see org.apache.ode.bpel.compiler.v2.ExpressionCompiler#compile(java.lang.Object)
     */
    private OExpression _compile(org.apache.ode.bpel.compiler.bom.Expression xpath, boolean isJoinCondition)
            throws CompilationException {
        OXPath20ExpressionBPEL20 oexp = new OXPath20ExpressionBPEL20(_compilerContext.getOProcess(), _qnVarData,
                _qnVarProp, _qnLinkStatus, _qnXslTransform, isJoinCondition);
        oexp.namespaceCtx = xpath.getNamespaceContext();
        doJaxpCompile(oexp, xpath);
        return oexp;
    }
View Full Code Here

    public void testCompilation() throws Exception {
        compile("$foo");
    }
   
    public void testVariableSelection() throws Exception {
        OXPath20ExpressionBPEL20 exp = compile("$foo");
        Node retVal = _runtime.evaluateNode(exp, this);
        assertNotNull(retVal);
        assertSame(retVal , _vars.get("foo"));
        assertSame(retVal.getOwnerDocument(),_vardoc);
    }
View Full Code Here

        assertSame(retVal , _vars.get("foo"));
        assertSame(retVal.getOwnerDocument(),_vardoc);
    }

    public void testVariableSelectionEmpty() throws Exception {
        OXPath20ExpressionBPEL20 exp = compile("$emptyVar");
        Node retVal = _runtime.evaluateNode(exp, this);
        assertNotNull(retVal);
        assertSame(retVal , _vars.get("emptyVar"));
        assertTrue(DOMUtils.getFirstChildElement((Element)retVal).getLocalName().equals("empty"));
    }
View Full Code Here

        assertSame(retVal , _vars.get("emptyVar"));
        assertTrue(DOMUtils.getFirstChildElement((Element)retVal).getLocalName().equals("empty"));
    }

    public void testVariableSelectionReallyEmpty() throws Exception {
        OXPath20ExpressionBPEL20 exp = compile("$reallyEmptyVar");
        Node retVal = _runtime.evaluateNode(exp, this);
        assertNotNull(retVal);
        assertSame(retVal , _vars.get("reallyEmptyVar"));
        assertNull(DOMUtils.getFirstChildElement((Element)retVal));
    }
View Full Code Here

   
    @Override
    public void setUp() throws Exception {
        _vars = new HashMap<String, Node>();
        _cc = new MockCompilerContext();
        _runtime = new XPath20ExpressionRuntime();      
        _runtime.initialize(new HashMap());
        _compiler = new XPath20ExpressionCompilerBPEL20();
        _compiler.setCompilerContext(_cc);
       
        _vardoc = DOMUtils.parse(getClass().getResourceAsStream("/xpath20/variables.xml"));
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.compiler.v1.xpath20.JaxpFunctionResolver$CombineUrl

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.