Package org.apache.xindice.xml.dom

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


                }

                DocumentImpl doc = new DocumentImpl();
                Element elem = doc.createElementNS(NodeSource.SOURCE_NS, "src:" + NodeSource.SOURCE_MODIFIED);
                elem.setAttribute(NodeImpl.XMLNS_PREFIX + ":src", NodeSource.SOURCE_NS);
                doc.appendChild(elem);
                Text count = doc.createTextNode(Integer.toString(xu.getModifiedCount()));
                elem.appendChild(count);

                return new NodeListSet(doc.getChildNodes());
            } catch (Exception e) {
View Full Code Here


                    if (table.containsKey(XMLTools.MAX_KEY_SIZE)) {
                        idxEle.setAttribute("maxkeysize", (String) table.get(XMLTools.MAX_KEY_SIZE));
                    }

                    // Add Element to the document
                    doc.appendChild(idxEle);

                    //If in verbose mode, show....
                    if ((String) table.get(XMLTools.VERBOSE) == "true") {
                        String indexstr = TextWriter.toString(doc);
                        System.out.println("Index node 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

            Document doc = new DocumentImpl();

            Element colEle = doc.createElement("collection");
            colEle.setAttribute("compressed", "true");
            colEle.setAttribute("name", name);
            doc.appendChild(colEle);

            Element filEle = doc.createElement("filer");
            filEle.setAttribute("class", "org.apache.xindice.core.filer.BTreeFiler");
            colEle.appendChild(filEle);
View Full Code Here

        // Turn the NodeSet into a document.
        DocumentImpl doc = new DocumentImpl();

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

            fail("Can't parse xml document! "+e.getMessage());
        }
        MetaData meta = new MetaData();
        meta.streamFromXML(doc.getDocumentElement(), true);
        Document doc2 = new DocumentImpl();
        doc2.appendChild(meta.streamToXML(doc2, true));
        assertEquals(TextWriter.toString(doc), TextWriter.toString(doc2));
    }
}
View Full Code Here

            throw new Exception(MISSING_NAME_PARAM);
        }
        String docname = (String) message.get(NAME);
        MetaData meta = col.getDocumentMeta(docname);
        Document doc = new DocumentImpl();
        doc.appendChild(meta.streamToXML(doc, true));

        Map result = new HashMap(3);
        result.put(RESULT, TextWriter.toString(doc));
        return result;
    }
View Full Code Here

            Document doc = new DocumentImpl();

            Element colEle = doc.createElement("collection");
            colEle.setAttribute("compressed", "true");
            colEle.setAttribute("name", name);
            doc.appendChild(colEle);

            Element filEle = doc.createElement("filer");
            filEle.setAttribute("class", "org.apache.xindice.core.filer.BTreeFiler");
            colEle.appendChild(filEle);
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

                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");
                String filerClass = "org.apache.xindice.core.filer.BTreeFiler";
                // see if user specified filer type
                if (table.containsKey(XMLTools.FILER)) {
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.