Package org.apache.xindice.xml.dom

Examples of org.apache.xindice.xml.dom.DocumentImpl.appendChild()


            log.trace(debugHeader() + "putObject: key=<" + key + "> class=<" + obj.getClass().getName() + ">");
        }

        Document doc = new DocumentImpl();
        ProcessingInstruction pi = doc.createProcessingInstruction(CLASSNAME, obj.getClass().getName());
        doc.appendChild(pi);
        Element elem = obj.streamToXML(doc);
        doc.appendChild(elem);
        return putDocument(key, doc, action);
    }
View Full Code Here


        Document doc = new DocumentImpl();
        ProcessingInstruction pi = doc.createProcessingInstruction(CLASSNAME, obj.getClass().getName());
        doc.appendChild(pi);
        Element elem = obj.streamToXML(doc);
        doc.appendChild(elem);
        return putDocument(key, doc, action);
    }

    /**
     * Lowest-level method for saving a binary entry into the database. At this moment,
View Full Code Here

            // meta information is not enabled !
            throw new Exception(MISSING_META_CONFIGURATION);
        }
        MetaData meta = col.getCollectionMeta();
        Document doc = new DocumentImpl();
        doc.appendChild(meta.streamToXML(doc, true));

        result.put(RESULT, TextWriter.toString(doc));
        return result;
    }
}
View Full Code Here

     */
    public static Document queryResultsToDOM(NodeSet nodeSet, boolean expandSource) {
        DocumentImpl doc = new DocumentImpl();

        Element root = doc.createElement("result");
        doc.appendChild(root);
        int count = 0;
        while (nodeSet != null && nodeSet.hasMoreNodes()) {
            final Object element = nodeSet.getNextNode();
            if (element instanceof Attr) {
                Attr n = (Attr) element;
View Full Code Here

                params.put(RPCDefaultMessage.NAME, id);
            }
            params.put(RPCDefaultMessage.COMPRESSED, "true");

            Document doc = new DocumentImpl();
            doc.appendChild(meta.streamToXML(doc, true));
            params.put(RPCDefaultMessage.META, TextWriter.toString(doc));

            // Object result =
            runRemoteCommand(id == null ? "SetCollectionMeta" : "SetDocumentMeta", params);
            // Document metaDoc = DOMParser.toDocument(result.toString());
View Full Code Here

    public Node getContextNode() {
        if (elem == null) {
            Document d = new DocumentImpl();
            elem = d.createElement("nsmap");
            d.appendChild(elem);
            Iterator i = entrySet().iterator();
            while (i.hasNext()) {
                Map.Entry entry = (Map.Entry) i.next();
                String pfx = (String) entry.getKey();
                String uri = (String) entry.getValue();
View Full Code Here

            XMLResource resource;
            if (bytes != null) {
                DocumentImpl doc = new DocumentImpl();
                doc.setSymbols(symbols);
                doc.importNode(n, true);
                doc.appendChild(n);
                byte[] b = DOMCompressor.compress(doc, symbols);
                resource = new XMLResourceImpl(null, documentId, collection, symbols, b);
            } else {
                resource = new XMLResourceImpl(null, documentId, collection, TextWriter.toString(n));
            }
View Full Code Here

        Element set = doc.createElementNS(RESOURCE_SET_NS, "xapi:resourceSet");
        set.setAttributeNS(RESOURCE_SET_NS, "xapi:collectionURI",
                           "xmldb:xindice://" + ((XindiceCollection) collection).getCanonicalName());
        set.setAttribute("xmlns:xapi", RESOURCE_SET_NS);
        doc.appendChild(set);

        int i = 0;
        while (i < resources.size()) {
            XMLResource res = (XMLResource) resources.get(i);
            Element resource = doc.createElementNS(RESOURCE_SET_NS,
View Full Code Here

            DocumentImpl doc = new DocumentImpl();
            doc.setSymbols(hcSyms);

            synchronized (syms) {
                Element elem = syms.streamToXML(doc);
                doc.appendChild(elem);

                symBytes = DOMCompressor.compress(doc, hcSyms);
                lastMod = lm;
            }
        }
View Full Code Here

                colEle.setAttribute("name", colName);
                // FIXME Make this configurable
                colEle.setAttribute("compressed", "true");
                colEle.setAttribute("inline-metadata", "true");

                doc.appendChild(colEle);

                Element filEle = doc.createElement("filer");
                filEle.setAttribute("class", "org.apache.xindice.core.filer.BTreeFiler");
                if (table.containsKey(XMLTools.PAGE_SIZE)) {
                    filEle.setAttribute("pagesize", (String) table.get(XMLTools.PAGE_SIZE));
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.