Package javax.xml.xquery

Examples of javax.xml.xquery.XQResultSequence


      {
        final QName var = new QName(col);
        expression.bindObject(var, parameters.get(col), null)// null = do not override the default object mapping
      }
      // execute query
      final XQResultSequence sequence = expression.executeQuery();
      while (sequence.next())
      {
        final XQItem item = sequence.getItem();
        System.out.println(item.getItemType().getTypeName());
        System.out.println(item.getAtomicValue());
      }
      // free result resources
      // sequence.close();
View Full Code Here


        checkNotClosed();
        try {
            StaticQueryContext env = sqc.getSaxonStaticQueryContext();
            XQueryExpression exp = env.compileQuery(query);
            SaxonXQPreparedExpression pe = new SaxonXQPreparedExpression(connection, exp, sqc, context);
            XQResultSequence result = pe.executeQuery();
            ((Closable)result).setClosableContainer(this);
            return result;
        } catch (XPathException e) {
            XQException xqe = new XQException(e.getMessage());
            xqe.initCause(e);
View Full Code Here

                funcResolver, null);
            exp.bindItem(XQConstants.CONTEXT_ITEM,
                xqconn.createItemFromNode(contextNode, xqconn.createNodeType()));

            // Execute query
            XQResultSequence result = exp.executeQuery();

            // Cast Saxon result to Java result
            Object evalResult = getResultValue(type, result);

            if ((evalResult != null) && __log.isDebugEnabled()) {
View Full Code Here

                transformer = (XQPreparedExpression) transformerPool.borrowObject();

                bindParameters(transformer, message);

                bindDocument(message.getPayload(), transformer);
                XQResultSequence result = transformer.executeQuery();
                //No support for return Arrays yet
                List<Object> results = new ArrayList<Object>();
                Class<?> type = returnType.getType();

                while (result.next())
                {
                    XQItem item = result.getItem();

                    if (Node.class.isAssignableFrom(type) || Node[].class.isAssignableFrom(type))
                    {
                        results.add(getItemValue(item));
                    }
View Full Code Here

                funcResolver, null);
            exp.bindItem(XQConstants.CONTEXT_ITEM,
                xqconn.createItemFromNode(contextNode, xqconn.createNodeType()));

            // Execute query
            XQResultSequence result = exp.executeQuery();

            // Cast Saxon result to Java result
            Object evalResult = getResultValue(type, result);

            if ((evalResult != null) && __log.isDebugEnabled()) {
View Full Code Here

                funcResolver, null);
            exp.bindItem(XQConstants.CONTEXT_ITEM,
                xqconn.createItemFromNode(contextNode, xqconn.createNodeType()));

            // Execute query
            XQResultSequence result = exp.executeQuery();

            // Cast Saxon result to Java result
            Object evalResult = getResultValue(type, result);

            if ((evalResult != null) && __log.isDebugEnabled()) {
View Full Code Here

                Node requestNode = DOMUtils.parse(request.newXMLStreamReader());
                if (__log.isDebugEnabled()) {
                    __log.debug("request " + request.toString());
                }
                exp.bindItem(XQConstants.CONTEXT_ITEM, xqconn.createItemFromNode(requestNode, xqconn.createNodeType()));
                XQResultSequence result = exp.executeQuery();
                MockQueryResponseDocument response = MockQueryResponseDocument.Factory.parse(result.getSequenceAsStream());
                {
                    XmlOptions opts = new XmlOptions();
                    List<Object> errors = new ArrayList<Object>();
                    opts.setErrorListener(errors);
                    if (!response.validate(opts)) {
View Full Code Here

                funcResolver, null);
            exp.bindItem(XQConstants.CONTEXT_ITEM,
                xqconn.createItemFromNode(contextNode, xqconn.createNodeType()));

            // Execute query
            XQResultSequence result = exp.executeQuery();

            // Cast Saxon result to Java result
            Object evalResult = getResultValue(type, result);

            if ((evalResult != null) && __log.isDebugEnabled()) {
View Full Code Here

                Node requestNode = DOMUtils.parse(request.newXMLStreamReader());
                if (__log.isDebugEnabled()) {
                    __log.debug("request " + request.toString());
                }
                exp.bindItem(XQConstants.CONTEXT_ITEM, xqconn.createItemFromNode(requestNode, xqconn.createNodeType()));
                XQResultSequence result = exp.executeQuery();
                MockQueryResponseDocument response = MockQueryResponseDocument.Factory.parse(result.getSequenceAsStream());
                {
                    XmlOptions opts = new XmlOptions();
                    List<Object> errors = new ArrayList<Object>();
                    opts.setErrorListener(errors);
                    if (!response.validate(opts)) {
View Full Code Here

        checkNotClosed();
        try {
            StaticQueryContext env = sqc.getSaxonStaticQueryContext();
            XQueryExpression exp = env.compileQuery(query);
            SaxonXQPreparedExpression pe = new SaxonXQPreparedExpression(connection, exp, sqc, context);
            XQResultSequence result = pe.executeQuery();
            ((Closable)result).setClosableContainer(this);
            return result;
        } catch (XPathException e) {
            XQException xqe = new XQException(e.getMessage());
            xqe.initCause(e);
View Full Code Here

TOP

Related Classes of javax.xml.xquery.XQResultSequence

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.