Package org.apache.xindice.xml.dom

Examples of org.apache.xindice.xml.dom.DocumentImpl


     * @exception XMLDBException
     */
    public Node getContentAsDOM() throws XMLDBException {
        try {
            if (bytes != null) {
                return new DocumentImpl(bytes, symbols, null);
            } else {
                return DOMParser.toDocument(content);
            }
        } catch (Exception e) {
            throw FaultCodes.createXMLDBException(e);
View Full Code Here


        }
        return parser.getDocument();
    }

    public Document newDocument() {
        return new DocumentImpl();
    }
View Full Code Here

        meta.streamFromXML(doc.getDocumentElement());
        col.setCollectionMeta(meta);

        // Retreive stored meta data and sent back
        meta = col.getCollectionMeta();
        doc = new DocumentImpl();
        doc.appendChild(meta.streamToXML(doc, true));
        result.put(RESULT, TextWriter.toString(doc));
        return result;
    }
View Full Code Here

        meta.streamFromXML(doc.getDocumentElement());
        col.setDocumentMeta(docname, meta);

        // Retreive stored meta data and sent back
        meta = col.getDocumentMeta(docname);
        doc = new DocumentImpl();
        meta.streamToXML(doc, true);
        result.put(RESULT, TextWriter.toString(doc));
        return result;
    }
View Full Code Here

                Key key = rec.getKey();
                Value val = rec.getValue();
                if (val.getLength() > 0) {
                    try {
                        if (compressed) {
                            Document doc = new DocumentImpl(val.getData(), symbols, new NodeSource(Collection.this, key));
                            return new ColContainer(key, doc);
                        } else {
                            return new ColContainer(key, DOMParser.toDocument(val));
                        }
                    } catch (Exception e) {
View Full Code Here

        if (!col.isMetaEnabled()) {
            // 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

        try {
            Object entry = col.getEntry(id);
            if (entry == null) {
                return null;
            } else if (entry instanceof Document) {
                DocumentImpl doc = (DocumentImpl) entry;

                // This should probably just pass the document.
                if (doc.getDataBytes() == null) {
                    return new XMLResourceImpl(id, id, this, TextWriter.toString(doc));
                } else {
                    return new XMLResourceImpl(id, id, this, doc.getSymbols(), doc.getDataBytes());
                }

            } else if (entry instanceof byte[]) {
                return new BinaryResourceImpl(id, this, (byte[])entry);
            } else {
View Full Code Here

        if (!message.containsKey(NAME)) {
            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

    /* see superclass for documentation */
    public org.xmldb.api.base.Collection createCollection(String name) throws XMLDBException {

        checkOpen();
        try {
            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);

            return createCollection(name, doc);
        } catch (Exception e) {
View Full Code Here

                    }
                } else {
                    xu.execute(context);
                }

                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) {
                if (e instanceof QueryException) {
                    throw (QueryException) e.fillInStackTrace();
                }
                throw new ProcessingException("Error executing XUpdate query", e);
View Full Code Here

TOP

Related Classes of org.apache.xindice.xml.dom.DocumentImpl

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.