Examples of SaxonXQDataSource


Examples of net.sf.saxon.xqj.SaxonXQDataSource

    private static class TestE implements Test {
        public String name() {
            return "TestE";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();
            XQPreparedExpression exp = conn.prepareExpression(
                    "<a xmlns='http://a/uri' xmlns:a='another.uri'><b>text</b></a>");
            XQResultSequence result = exp.executeQuery();
            result.next();
            XQItem resultItem = result.getItem();
View Full Code Here

Examples of net.sf.saxon.xqj.SaxonXQDataSource

    private static class TestF implements Test {
        public String name() {
            return "TestF";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();
            XQPreparedExpression exp = conn.prepareExpression(
                    "document { <a xmlns='http://a/uri' z:in='out' xmlns:z='http://z/uri'><b>{2+2}</b></a> }");
            XQResultSequence result = exp.executeQuery();
            result.next();
            result.writeItemToSAX(new ExampleContentHandler());
View Full Code Here

Examples of net.sf.saxon.xqj.SaxonXQDataSource

    private static class TestG implements Test {
        public String name() {
            return "TestG";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();
            XQPreparedExpression exp = conn.prepareExpression(
                    "document { <a xmlns='http://a/uri' z:in='out' xmlns:z='http://z/uri'><b>{2+2}</b></a> }");
            XQResultSequence result = exp.executeQuery();
            XMLStreamReader reader = result.getSequenceAsStream();
View Full Code Here

Examples of net.sf.saxon.xqj.SaxonXQDataSource

    private static class TestH implements Test {
        public String name() {
            return "TestH";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();
            XQPreparedExpression exp = conn.prepareExpression(
                    "(1, 'peach', xs:date('1951-10-11'), xs:duration('PT5M'), 93.7e0, '<the end>')");
            XQResultSequence result = exp.executeQuery();
            XMLStreamReader reader = result.getSequenceAsStream();
View Full Code Here

Examples of net.sf.saxon.xqj.SaxonXQDataSource

    private static class TestI implements Test {
        public String name() {
            return "TestI";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();
            XQPreparedExpression exp = conn.prepareExpression(
                    "document { <a xmlns='http://a/uri' z:in='out' xmlns:z='http://z/uri'>" +
                    "<b xmlns='http://b/uri'>{2+2}</b>" +
                    "</a> }");
            XQResultSequence result = exp.executeQuery();
View Full Code Here

Examples of net.sf.saxon.xqj.SaxonXQDataSource

    private static class TestJ implements Test {
        public String name() {
            return "TestJ";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();
            if (!conn.getMetaData().isSchemaValidationFeatureSupported()) {
                System.out.println("*** This test requires Saxon-EE");
                return;
            }
            File inputFile = new File("data/books.xml");
View Full Code Here

Examples of net.sf.saxon.xqj.SaxonXQDataSource

    private static class TestK implements Test {
        public String name() {
            return "TestK";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();
            if (!conn.getMetaData().isSchemaValidationFeatureSupported()) {
                System.out.println("*** This test requires Saxon-EE");
                return;
            }
            File inputFile = new File("data/books.xml");
View Full Code Here

Examples of net.sf.saxon.xqj.SaxonXQDataSource

    private static class TestL implements Test {
        public String name() {
            return "TestL";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();

            XQPreparedExpression exp = conn.prepareExpression(
                    "declare namespace jt = 'http://saxon.sf.net/java-type';\n" +
                    "declare namespace Locale = 'java:java.util.Locale';\n" +
                    "declare variable $locale as jt:java.util.Locale external;\n" +
View Full Code Here

Examples of net.sf.saxon.xqj.SaxonXQDataSource

            return "TestZ";
        }

        public void run() throws XQException {
            try {
                XQConnection conn = new SaxonXQDataSource().getConnection();
                DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
                    System.err.println("Using DocumentBuilderFactory " + dfactory.getClass());

                dfactory.setNamespaceAware(true);
View Full Code Here

Examples of net.sf.saxon.xqj.SaxonXQDataSource

        if (xqueryStr.length() == 0) {
            throw new CompilationException(__msgs.warnXPath20Syntax(DOMUtils.domToString(node), "empty string"));
        }

        try {
          XQDataSource xqds = new SaxonXQDataSource();
            XQConnection xqconn = xqds.getConnection();
           
            __log.debug("Compiling expression " + xqueryStr);
            Configuration configuration = ((SaxonXQConnection) xqconn).getConfiguration();
            configuration.setAllNodesUntyped(true);
            configuration.setHostLanguage(Configuration.XQUERY);
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.