Package com.marklogic.xcc.types

Examples of com.marklogic.xcc.types.XdmItem


            ResultSequence rs = session.submitRequest (request);

            while (rs.hasNext()) {
                ResultItem rsItem = rs.next();
                XdmItem item = rsItem.getItem();

                // FIXME: This needs work...
                if (item instanceof XdmDocument || item instanceof XdmElement) {
                    XdmNode xccXML = parseString(item.asString());
                    result.write(xccXML);
                } else {
                    String text = item.asString();
                    TreeWriter treeWriter = new TreeWriter(runtime);
                    treeWriter.startDocument(step.getNode().getBaseURI());
                    treeWriter.addStartElement(wrapper);
                    treeWriter.startContent();
                    treeWriter.addText(text);
View Full Code Here


            ResultSequence rs = session.submitRequest (request);

            while (rs.hasNext()) {
                ResultItem rsItem = rs.next();
                XdmItem item = rsItem.getItem();

                // FIXME: This needs work...
                if (item instanceof XdmDocument || item instanceof XdmElement) {
                    XdmNode xccXML = parseString(item.asString());
                    result.write(xccXML);
                } else if (item instanceof XdmBinary) {
                    String base64 = Base64.encodeBytes(((XdmBinary) item).asBinaryData());
                    TreeWriter treeWriter = new TreeWriter(runtime);
                    treeWriter.startDocument(step.getNode().getBaseURI());
                    treeWriter.addStartElement(wrapper);

                    if (XProcConstants.NS_XPROC_STEP.equals(wrapper.getNamespaceURI())) {
                        treeWriter.addAttribute(_encoding, "base64");
                    } else {
                        treeWriter.addAttribute(c_encoding, "base64");
                    }

                    treeWriter.startContent();
                    treeWriter.addText(base64);
                    treeWriter.addEndElement();
                    treeWriter.endDocument();
                    XdmNode node = treeWriter.getResult();
                    result.write(node);
                } else {
                    String text = item.asString();
                    TreeWriter treeWriter = new TreeWriter(runtime);
                    treeWriter.startDocument(step.getNode().getBaseURI());
                    treeWriter.addStartElement(wrapper);
                    treeWriter.startContent();
                    treeWriter.addText(text);
View Full Code Here

        } finally {
            session.close();
        }
        while (rs.hasNext()) {
            ResultItem rsItem = rs.next();
            XdmItem item = rsItem.getItem();
            if (rsItem.getIndex() == 0 && item.asString().equals("0")) {
                options.setModulesDatabase("");
            }
            if (rsItem.getIndex() == 1) {
                options.setXDBC_ROOT(item.asString());
            }
        }
        logger.info("Configured modules db: "
                + options.getModulesDatabase());
        logger.info("Configured modules root: " + options.getXDBC_ROOT());
View Full Code Here

TOP

Related Classes of com.marklogic.xcc.types.XdmItem

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.