Package org.apache.xindice.xml.dom

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


                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,
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

            // 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

            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);
        putDocument(key, doc /*, create */);
    }

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);
        putDocument(key, doc /*, create */);
    }

    /**
     * queryCollection performs a query against the current collection
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));

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

    public Node getContextNode() {
        if (elem == null) {
            Document d = new DocumentImpl();
            elem = d.createElement("nsmap");
            d.appendChild(elem);
            Iterator i = keySet().iterator();
            while (i.hasNext()) {
                String pfx = (String) i.next();
                if (pfx.equals("")) {
                    elem.setAttribute("xmlns", (String) get(pfx));
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)
            {
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

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

                doc.appendChild(colEle);

                Element filEle = doc.createElement("filer");
                filEle.setAttribute("class", "org.apache.xindice.core.filer.BTreeFiler");
                //filEle.setAttribute("gzip", "true");
                if (table.containsKey(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.