Examples of DocumentImpl


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

      if ( compressed ) {
         try {
            byte[] b = DOMCompressor.Compress(document, symbols);
            value = new Value(b);

            document = new DocumentImpl(b, symbols, new NodeSource(this, key));
         }
         catch ( Exception e ) {
            throw new DBException(FaultCodes.COL_CANNOT_STORE, "Error storing Document '"+key+"'", e);
         }
      } else {
View Full Code Here

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

            return null;

         Value value = record.getValue();

         if ( compressed ) {
            doc = new DocumentImpl(value.getData(), symbols, new NodeSource(this, key));

            if ( documentCache != null )
               documentCache.putDocument(this, key, value.getData());
         }
         else
View Full Code Here

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

      return null;
   }

   private void putObject(Key key, XMLSerializable obj /*, boolean create */) throws DBException {
      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

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

    * @return The Content value
    * @exception XMLDBException
    */
   public Object getContent() throws XMLDBException {
      if ( bytes != null ) {
         DocumentImpl doc = new DocumentImpl(bytes, symbols, null);
         return TextWriter.toString(doc);
      }
      else
         return content;
   }
View Full Code Here

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

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

            Key key = rec.getKey();
            Value val = rec.getValue();
            if ( val.getData() != null ) {
               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));
               }
View Full Code Here

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

public final class NamespaceMap extends HashMap {
   private Element elem = null;

   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

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

         doc = (Document)v;
      else if ( v instanceof byte[] ) {
         try {
            SymbolTable s = col.getSymbols();
            NodeSource ns = new NodeSource(col, key);
            doc = new DocumentImpl((byte[])v, s, ns);
         }
         catch ( Exception e ) {
         }
      }
      return doc;
View Full Code Here

Examples of org.exist.dom.DocumentImpl

      try {
           source = broker.openCollection(uri.removeLastSegment(), Lock.WRITE_LOCK);
          if(source == null) {
            return false;
              }
          final DocumentImpl doc = source.getDocument(broker, uri.lastSegment());
              if(doc == null) {
                  return false;
              }
              destination = broker.openCollection(destinationPath.removeLastSegment(), Lock.WRITE_LOCK);
              if(destination == null) {
View Full Code Here

Examples of org.exist.memtree.DocumentImpl

                        }
                        // make this document persistent: doc.makePersistent()
                        // returns a map of all root node ids mapped to the corresponding
                        // persistent node. We scan the current sequence and replace all
                        // in-memory nodes with their new persistent node objects.
                        final DocumentImpl expandedDoc = doc.expandRefs(null);
                        final org.exist.dom.DocumentImpl newDoc = expandedDoc.makePersistent();
                        if (newDoc != null) {
                            NodeId rootId = newDoc.getBrokerPool().getNodeFactory().createInstance();
                            for (int j = i; j < count; j++) {
                                v = (NodeValue) items[j].item;
                                if(v.getImplementationType() != NodeValue.PERSISTENT_NODE) {
                                    NodeImpl node = (NodeImpl) v;
                                    if (node.getDocument() == doc) {
                                        node = expandedDoc.getNode(node.getNodeNumber());
                                        NodeId nodeId = node.getNodeId();
                                        if (nodeId == null)
                                            {throw new XPathException("Internal error: nodeId == null");}
                                        if (node.getNodeType() == Node.DOCUMENT_NODE)
                                            {nodeId = rootId;}
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.