Package org.apache.xindice.xml.dom

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


         if ( n instanceof DBNode ) {
            ( ( DBNode ) n ).expandSource();
         }

         root.appendChild( doc.importNode( n, true ) );
         count++;
      }

      root.setAttribute( "count", Integer.toString( count ) );
View Full Code Here


               NodeSource.SOURCE_NS, "key");

            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);
            }
View Full Code Here

         Element resource = doc.createElementNS(RESOURCE_SET_NS,
            "xapi:resource");
         resource.setAttributeNS(RESOURCE_SET_NS, "xapi:documentID",
            res.getDocumentId());

         resource.appendChild(doc.importNode(
            ((Document) res.getContentAsDOM()).getDocumentElement(), true));

         set.appendChild(resource);

         i++;
View Full Code Here

                }

                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 {
View Full Code Here

            Element resource = doc.createElementNS(RESOURCE_SET_NS,
                                                   "xapi:resource");
            resource.setAttributeNS(RESOURCE_SET_NS, "xapi:documentID",
                                    res.getDocumentId());

            resource.appendChild(doc.importNode(
                    ((Document) res.getContentAsDOM()).getDocumentElement(), true));

            set.appendChild(resource);

            i++;
View Full Code Here

   
                if (n instanceof DBNode) {
                    ((DBNode) n).expandSource();
                }
   
                root.appendChild(doc.importNode(n, true));
            }
            else if (element instanceof Boolean || element instanceof Double)
            {
                root.appendChild(doc.createTextNode(element.toString()));
            }
View Full Code Here

                if (n instanceof DBNode) {
                    ((DBNode) n).expandSource();
                }

                root.appendChild(doc.importNode(n, true));
            } else if (element instanceof Boolean || element instanceof Double) {
                root.appendChild(doc.createTextNode(element.toString()));
            } else if (element instanceof String) {
                root.appendChild(doc.createTextNode((String) element));
            } else {
View Full Code Here

            if (element instanceof Attr) {
                Attr n = (Attr) element;

                Element holder = doc.createElementNS(XindiceCollection.QUERY_NS, "xq:result");
                holder.setAttribute(NodeImpl.XMLNS_PREFIX + ":xq", XindiceCollection.QUERY_NS);
                holder.setAttributeNode((Attr) doc.importNode(n, true));

                if (expandSource && n instanceof DBNode) {
                    ((DBNode) holder).setSource(((DBNode) n).getSource());
                    ((DBNode) holder).expandSource();
                }
View Full Code Here

            } else if (element instanceof Text || element instanceof Comment) {
                Node n = (Node) element;

                Element holder = doc.createElementNS(XindiceCollection.QUERY_NS, "xq:result");
                holder.setAttribute(NodeImpl.XMLNS_PREFIX + ":xq", XindiceCollection.QUERY_NS);
                holder.appendChild(doc.importNode(n, true));

                if (expandSource && n instanceof DBNode) {
                    ((DBNode) holder).setSource(((DBNode) n).getSource());
                    ((DBNode) holder).expandSource();
                }
View Full Code Here

                if (expandSource && n instanceof DBNode) {
                    ((DBNode) n).expandSource();
                }

                root.appendChild(doc.importNode(n, true));
            } else {
                throw new XindiceRuntimeException("Unknown result type (" + element.getClass().getName() + ") in nodeset");
            }

            count++;
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.