Examples of newStaticQueryContext()


Examples of net.sf.saxon.Configuration.newStaticQueryContext()

     * their mapping to XPath data types, see {@link XPathEvaluator#evaluate}
     */

    public static void exampleWithParam() throws XPathException {
        final Configuration config = new Configuration();
        final StaticQueryContext sqc = config.newStaticQueryContext();
        final XQueryExpression exp = sqc.compileQuery("declare variable $in as xs:integer external;" +
                "$in * $in");

        final DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
        dynamicContext.setParameterValue("in", Int64Value.makeIntegerValue(17));
View Full Code Here

Examples of net.sf.saxon.Configuration.newStaticQueryContext()

    public static void examplePipeline() throws XPathException {
        final Configuration config = new Configuration();

        // Compile the first query
        final StaticQueryContext sqc1 = config.newStaticQueryContext();
        final XQueryExpression exp1 = sqc1.compileQuery("declare variable $in as xs:integer external;" +
                "document{ <a>{$in * $in}</a> }");

        // Compile the second query (each query should have its own static context)
        final StaticQueryContext sqc2 = config.newStaticQueryContext();
View Full Code Here

Examples of net.sf.saxon.Configuration.newStaticQueryContext()

        final StaticQueryContext sqc1 = config.newStaticQueryContext();
        final XQueryExpression exp1 = sqc1.compileQuery("declare variable $in as xs:integer external;" +
                "document{ <a>{$in * $in}</a> }");

        // Compile the second query (each query should have its own static context)
        final StaticQueryContext sqc2 = config.newStaticQueryContext();
        final XQueryExpression exp2 = sqc2.compileQuery("/a + 5");

        // Run the first query
        final DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
        dynamicContext.setParameterValue("in", Int64Value.makeIntegerValue(3));
View Full Code Here

Examples of net.sf.saxon.Configuration.newStaticQueryContext()

     * checking of the supplied arguments
     */

    public static void exampleDirectFunction() throws XPathException {
        final Configuration config = new Configuration();
        final StaticQueryContext sqc = config.newStaticQueryContext();
        final XQueryExpression exp1 = sqc.compileQuery("declare namespace f='f.ns';" +
                "declare function f:t1($v1 as xs:integer, $v2 as xs:untypedAtomic*) { " +
                "   $v1 div $v2" +
                "};" +
                "10");
View Full Code Here

Examples of net.sf.saxon.Configuration.newStaticQueryContext()

                if (test != -1 && test != q) {
                    continue;
                }
                try {
                    File query = new File(dir + 'q' + q + ".xq");
                    StaticQueryContext qenv = config.newStaticQueryContext();
                    qenv.setBaseURI(query.toURI().toString());
                    if (val) {
                        qenv.setSchemaAware(true);
                    }
                    XQueryExpression exp = qenv.compileQuery(new FileReader(query));
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.