Package net.sf.saxon.sxpath

Examples of net.sf.saxon.sxpath.IndependentContext.declareVariable()


            // self-declaring variables modify the static context. The XPathCompiler must not change state
            // as the result of compiling an expression, so we need to copy the static context.
            ic = env.copy();
            for (Iterator iter = env.iterateExternalVariables(); iter.hasNext();) {
                XPathVariable var = (XPathVariable)iter.next();
                XPathVariable var2 = ic.declareVariable(var.getVariableQName());
                var2.setRequiredType(var.getRequiredType());
            }
        }
        try {
            XPathEvaluator eval = new XPathEvaluator(processor.getUnderlyingConfiguration());
View Full Code Here


        IndependentContext env = staticContext.copy();
        env.setFunctionLibrary(getExecutable().getFunctionLibrary());
        pexpr.expStaticContext = env;
        pexpr.variables = new XPathVariable[10];
        for (int i=1; i<10; i++) {
            pexpr.variables[i-1] = env.declareVariable("", "p"+i);
        }

        Expression expr;
        try {
            expr = ExpressionTool.make(exprText, env, 0, Token.EOF, 1, false);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.