Package net.sf.saxon.s9api

Examples of net.sf.saxon.s9api.XPathExecutable


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

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

        selector.setVariable(doca,sdoc);
        selector.setVariable(docb,adoc);

        Iterator<XdmItem> values = selector.iterator();
View Full Code Here


        try {
            XPathCompiler c = proc.newXPathCompiler();
            c.declareVariable(vara);
            c.declareVariable(varb);

            XPathExecutable xexec = c.compile("$vara = $varb");
            XPathSelector selector = xexec.load();

            selector.setVariable(vara,a);
            selector.setVariable(varb,b);

            Iterator<XdmItem> values = selector.iterator();
View Full Code Here

                    for (String prefix : lclnsBindings.keySet()) {
                        xcomp.declareNamespace(prefix, lclnsBindings.get(prefix));
                    }

                    XPathExecutable xexec = xcomp.compile(nsbinding.getXPath());
                    XPathSelector selector = xexec.load();

                    for (QName varname : globals.keySet()) {
                        XdmAtomicValue avalue = new XdmAtomicValue(globals.get(varname).getString());
                        selector.setVariable(varname,avalue);
                    }
View Full Code Here

            }

            for (String prefix : nsBindings.keySet()) {
                xcomp.declareNamespace(prefix, nsBindings.get(prefix));
            }
            XPathExecutable xexec = null;
            try {
                xexec = xcomp.compile(xpath);
            } catch (SaxonApiException sae) {
                Throwable t = sae.getCause();
                if (t instanceof XPathException) {
                    XPathException xe = (XPathException) t;
                    if (xe.getMessage().contains("Undeclared (or unbound?) variable")) {
                        throw XProcException.dynamicError(26, step.getNode(), xe.getMessage());
                    }
                }
                throw sae;
            }

            XPathSelector selector = xexec.load();

            for (QName varname : boundOpts.keySet()) {
                XdmValue value = null;
                RuntimeValue rval = boundOpts.get(varname);
                if (runtime.getAllowGeneralExpressions() && rval.hasGeneralValue()) {
View Full Code Here

        for (String prefix : test.getNamespaceBindings().keySet()) {
            xcomp.declareNamespace(prefix, test.getNamespaceBindings().get(prefix));
        }

        XPathExecutable xexec = xcomp.compile(test.getString());

        // From Michael Kay: http://markmail.org/message/vkb2vaq2miylgndu
        //
        // Underneath the s9api XPathExecutable is a net.sf.saxon.sxpath.XPathExpression.

        XPathExpression xexpr = xexec.getUnderlyingExpression();

        int pos = 0;
        while (source.moreDocuments()) {
            XdmNode doc = source.read();
            pos++;
View Full Code Here

        for (String prefix : label.getNamespaceBindings().keySet()) {
            xcomp.declareNamespace(prefix, label.getNamespaceBindings().get(prefix));
        }
        xcomp.declareVariable(p_index);

        XPathExecutable xexec = xcomp.compile(label.getString());
        XPathSelector selector = xexec.load();

        selector.setVariable(p_index,new XdmAtomicValue(count++));

        selector.setContextItem(node);
View Full Code Here

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

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

                        selector.setVariable(doca, is_doc);
                        selector.setVariable(docb, os_doc);

                        Iterator<XdmItem> values = selector.iterator();
View Full Code Here

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

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

                        selector.setVariable(doca,tdoc);
                        selector.setVariable(docb,pdoc);

                        Iterator<XdmItem> values = selector.iterator();
View Full Code Here

            for (String prefix : groupAdjacent.getNamespaceBindings().keySet()) {
                xcomp.declareNamespace(prefix, groupAdjacent.getNamespaceBindings().get(prefix));
            }

            XPathExecutable xexec = xcomp.compile(groupAdjacent.getString());
            XPathSelector selector = xexec.load();
            selector.setContextItem(node);

            Iterator<XdmItem> values = selector.iterator();
            if (values.hasNext()) {
                return values.next();
View Full Code Here

        for (String prefix : nsBindings.keySet()) {
            xcomp.declareNamespace(prefix, nsBindings.get(prefix));
        }

        try {
            XPathExecutable xexec = xcomp.compile(select);
            selector = xexec.load();
        } catch (SaxonApiException sae) {
            throw new XProcException(sae);
        }

        try {
View Full Code Here

TOP

Related Classes of net.sf.saxon.s9api.XPathExecutable

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.