Package net.sf.saxon.xqj

Examples of net.sf.saxon.xqj.SaxonXQDataSource


            synchronized (resourceLock) {

                //creating data source
                if (cachedXQDataSource == null) {
                    // A factory for XQConnection  objects
                    cachedXQDataSource = new SaxonXQDataSource();
                    //setting up the properties to the XQDataSource
                    if (dataSourceProperties != null && !dataSourceProperties.isEmpty()) {
                        synLog.traceOrDebug("Setting up properties to the XQDataSource");
                        for (MediatorProperty dataSourceProperty : dataSourceProperties) {
                            if (dataSourceProperty != null) {
View Full Code Here


            synchronized (resourceLock) {

                //creating data source
                if (cachedXQDataSource == null) {
                    // A factory for XQConnection  objects
                    cachedXQDataSource = new SaxonXQDataSource();
                    //setting up the properties to the XQDataSource
                    if (dataSourceProperties != null && !dataSourceProperties.isEmpty()) {
                        if (traceOrDebugOn) {
                            traceOrDebug(traceOn, "Setting up properties to the XQDataSource");
                        }
View Full Code Here

            synchronized (resourceLock) {

                //creating data source
                if (cachedXQDataSource == null) {
                    // A factory for XQConnection  objects
                    cachedXQDataSource = new SaxonXQDataSource();
                    //setting up the properties to the XQDataSource
                    if (dataSourceProperties != null && !dataSourceProperties.isEmpty()) {
                        synLog.traceOrDebug("Setting up properties to the XQDataSource");
                        for (MediatorProperty dataSourceProperty : dataSourceProperties) {
                            if (dataSourceProperty != null) {
View Full Code Here

            try {
                MockQueryRequestDocument request = MockQueryRequestDocument.Factory.newInstance();
                request.addNewMockQueryRequest().addNewIn().set(XmlObject.Factory.parse(outgoingMessage));
                String xquery = serviceConfig.getReplayType().getMockQuery();

                XQDataSource xqds = new SaxonXQDataSource();
                XQConnection xqconn = xqds.getConnection();

                net.sf.saxon.Configuration configuration = ((SaxonXQConnection) xqconn).getConfiguration();
                configuration.setHostLanguage(net.sf.saxon.Configuration.XQUERY);
//                XQStaticContext staticEnv = xqconn.getStaticContext();
                XQPreparedExpression exp = xqconn.prepareExpression(xquery);
View Full Code Here

            if (configuration == null)
            {
                configuration = new Configuration();
            }

            XQDataSource ds = new SaxonXQDataSource(configuration);
            if (commonHandler != null)
            {
                ds.setCommonHandler(commonHandler);
            }
            connection = ds.getConnection();

            transformerPool.addObject();

        }
        catch (Throwable te)
View Full Code Here

    private static class TestA implements Test {
        public String name() {
            return "TestA";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();
            XQPreparedExpression exp = conn.prepareExpression("<a b='c'>{5+2}</a>");
            XQResultSequence result = exp.executeQuery();
            while (result.next()) {
                System.out.println(result.getItemAsString(null));
            }
View Full Code Here

    private static class TestB implements Test {
        public String name() {
            return "TestB";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();
            XQExpression exp = conn.createExpression();
            XQSequence seq = exp.executeQuery("for $n in 1 to 10 return $n*$n");
            int total = 0;
            while (seq.next()) {
                total += seq.getInt();
View Full Code Here

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

            exp.bindString(XQConstants.CONTEXT_ITEM, "banana", null);
            XQSequence seq = exp.executeQuery("contains(., 'e')");
            seq.next();
View Full Code Here

    private static class TestD implements Test {
        public String name() {
            return "TestD";
        }
        public void run() throws XQException {
            XQDataSource ds = new SaxonXQDataSource();
            XQConnection conn = ds.getConnection();
            XQPreparedExpression exp = conn.prepareExpression(
                    "declare variable $v as xs:string external; contains($v, 'e')");
            QName v = new QName("v");

            exp.bindObject(v, "banana", null);
View Full Code Here

    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

TOP

Related Classes of net.sf.saxon.xqj.SaxonXQDataSource

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.