Examples of declareVariable()


Examples of net.sf.saxon.s9api.XPathCompiler.declareVariable()

        XdmNode sdoc = source.read();
        XdmNode adoc = alternate.read();

        XPathCompiler xcomp = runtime.getProcessor().newXPathCompiler();
        xcomp.declareVariable(doca);
        xcomp.declareVariable(docb);

        XPathExecutable xexec = xcomp.compile("deep-equal($doca,$docb)");
        XPathSelector selector = xexec.load();
View Full Code Here

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

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

                Map.Entry entry = (Map.Entry) namespaceMap[i];
                sc.declareNamespace((String) entry.getKey(),
                        (String) entry.getValue());
            }
            xpe.setStaticContext(sc);
            XPathVariable thisVar = xpe.declareVariable("", contextVar);
            XPathExpression xpath = xpe.createExpression(path);
            NodeInfo contextItem =
                //config.buildDocument(new DOMSource(contextNode));
                config.unravel(new DOMSource(contextNode));
            XPathDynamicContext dc = xpath.createDynamicContext(null);
View Full Code Here

Examples of net.sf.saxon.xpath.StandaloneContext.declareVariable()

        XPathEvaluator xpe = new XPathEvaluator(ss);

        // Declare a variable for use in XPath expressions

        StandaloneContext sc = (StandaloneContext)xpe.getStaticContext();
        Variable wordVar = sc.declareVariable("word", "");

        // Compile the XPath expressions used by the application

        XPathExpression findLine =
            xpe.createExpression("//LINE[contains(., $word)]");
View Full Code Here

Examples of org.apache.commons.jxpath.AbstractFactory.declareVariable()

    }

    public NodePointer createPath(JXPathContext context) {
        if (!actual) {
            AbstractFactory factory = getAbstractFactory(context);
            if (!factory.declareVariable(context, name.toString())) {
                throw new JXPathException(
                    "Factory cannot define variable '"
                        + name
                        + "' for path: "
                        + asPath());
View Full Code Here

Examples of org.apache.commons.jxpath.AbstractFactory.declareVariable()

    }

    public NodePointer createPath(JXPathContext context) {
        if (!actual) {
            AbstractFactory factory = getAbstractFactory(context);
            if (!factory.declareVariable(context, name.toString())) {
                throw new JXPathAbstractFactoryException(
                        "Factory cannot define variable '" + name
                                + "' for path: " + asPath());
            }
            findVariables(context);
View Full Code Here

Examples of org.apache.commons.jxpath.AbstractFactory.declareVariable()

    }

    public NodePointer createPath(JXPathContext context){
        if (!actual){
            AbstractFactory factory = getAbstractFactory(context);
            if (!factory.declareVariable(context, name.toString())){
                throw new JXPathException("Factory cannot define variable '" + name + "' for path: " + asPath());
            }
            findVariables(context);
            // Assert: actual == true
        }
View Full Code Here

Examples of org.apache.commons.jxpath.Variables.declareVariable()

    public void setUp() {
        if (context == null) {
            context = JXPathContext.newContext(new TestMixedModelBean());
            Variables vars = context.getVariables();
            vars.declareVariable("nan", new Double(Double.NaN));
        }
    }

    public void testCoreFunctions() {
        assertXPathValue(context, "string(2)", "2");
View Full Code Here

Examples of org.apache.commons.jxpath.Variables.declareVariable()

    public void setUp() {
        if (context == null) {
            context = JXPathContext.newContext(null);
            Variables vars = context.getVariables();
            vars.declareVariable("integer", new Integer(1));
        }
    }

    public void testInfoSetTypes() {
View Full Code Here

Examples of org.apache.commons.jxpath.Variables.declareVariable()

        TestMixedModelBean bean = new TestMixedModelBean();
        context = JXPathContext.newContext(bean);
        context.setFactory(new TestMixedModelFactory());
        context.setLocale(Locale.US);
        Variables vars = context.getVariables();
        vars.declareVariable("string", bean.getString());
        vars.declareVariable("bean", bean.getBean());
        vars.declareVariable("map", bean.getMap());
        vars.declareVariable("list", bean.getList());
        vars.declareVariable("document", bean.getDocument());
        vars.declareVariable("element", bean.getElement());
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.