Package org.w3c.dom

Examples of org.w3c.dom.Document.importNode()


       
        Element contentMessage = dom.createElement("message");
        Element contentPart = dom.createElement(bpelOperationInputPart.getName());
        Element contentInvocation = (Element) args[0];
       
        contentPart.appendChild(dom.importNode(contentInvocation, true));
        contentMessage.appendChild(contentPart);
        dom.appendChild(contentMessage);
       
        System.out.println("::arg:::::: " + DOMUtils.domToString((Element) args[0]));
        System.out.println("::message:: " + DOMUtils.domToString(dom.getDocumentElement()));
View Full Code Here


     * @throws Exception if an error occurs
     */
    public org.w3c.dom.Document getDOMDocumentClone() throws Exception {
        Document documentClone = DocumentHelper.createDocument(null, "dummy", null);
        documentClone.removeChild(documentClone.getDocumentElement());
        documentClone.appendChild(documentClone.importNode(document.getDocumentElement(), true));

        return documentClone;
    }

    /**
 
View Full Code Here

            } else {
                Document doc = createDocument();
                // import node must not occur concurrent on the same node (must be its owner)
                // so we need to synchronize on it
                synchronized (node.getOwnerDocument()) {
                    doc.appendChild(doc.importNode(node, true));
                }
                return doc;
            }
            // other element types are not handled
        } else {
View Full Code Here

  private void copyFragment(DocumentFragment source, Node dest) {
    Document destDoc = dest.getOwnerDocument();
    NodeList nodes = source.getChildNodes();
    for (int i = 0; i < nodes.getLength(); i++) {
      Node clone = destDoc.importNode(nodes.item(i), true);
      dest.appendChild(clone);
    }   
  }
 
  protected boolean shouldCache() {
View Full Code Here

   /** Converts an element to a String representation. */
   private static String toString(Element element, Properties properties) throws ParserConfigurationException, TransformerException
   {
      Document doc = getDocumentBuilderFactory().newDocumentBuilder().newDocument();
      element = (Element)doc.importNode(element, true);
      doc.appendChild(element);
      return toString(doc, properties);
   }

   /** Converts an document to a String representation. */
 
View Full Code Here

         throw new IllegalArgumentException();
      }

      //
      Document doc = getDocumentBuilderFactory().newDocumentBuilder().newDocument();
      element = (Element)doc.importNode(element, true);
      doc.appendChild(element);
      return doc;
   }

   /**
 
View Full Code Here

            } else {
                Document doc = createDocument();
                // import node must not occur concurrent on the same node (must be its owner)
                // so we need to synchronize on it
                synchronized (node.getOwnerDocument()) {
                    doc.appendChild(doc.importNode(node, true));
                }
                return doc;
            }
            // other element types are not handled
        } else {
View Full Code Here

        DocumentFragment fragment = (DocumentFragment)result;

        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.newDocument();
        Node importedFragment = doc.importNode(fragment, true);
        doc.appendChild(doc.createElement("root"));
        doc.getFirstChild().appendChild(importedFragment);

    }
View Full Code Here

        copyInto(n);
        if (deep) {
            for (Node c = getFirstChild();
                 c != null;
                 c = c.getNextSibling()) {
                n.appendChild(n.importNode(c, deep));
            }
        }
        return n;
    }
View Full Code Here

            Element[] namespaceImports = (Element[]) namespaceImportsMap
                    .values().toArray(new Element[namespaceImportsMap.size()]);
            for (int i = 0; i < namespaceImports.length; i++) {
                if (!namespaceURI.equals(namespaceImports[i]
                        .getAttribute(NAMESPACE_URI))) {
                    schemaElement.appendChild(ownerDocument.importNode(
                            namespaceImports[i], true));
                }
            }

            Element[] elementDeclarations = (Element[]) elementElementsList
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.