Package org.w3c.dom

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


                } else if (nl.item(i) instanceof Text) {
                    targetElem = ((Text) nl.item(i)).getWholeText();
                } else {
                    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    Document doc = builder.newDocument();
                    targetElem  = doc.importNode(nl.item(i), true);
                }
                target = targetElem;
            } else {
                org.w3c.dom.Node n  = ((org.w3c.dom.Node) targetElem).getOwnerDocument().importNode(nl.item(i), true);
                if (n instanceof Attr) {
View Full Code Here


      try {
         Node tempNode = SvgUtility.createDocument(completeSVG, "file://dummy.svg").getDocumentElement().getFirstChild();

         Document doc = el.getOwnerDocument();
         tempNode = doc.importNode(tempNode, true);

         Node parentNode = el.getParentNode();
         parentNode.replaceChild(tempNode, el);

         GraphicsNode graphicsNode = this.bridgeContext.getGVTBuilder().build(this.bridgeContext, (Element)tempNode);
View Full Code Here

      source = ((Document) sourceNode).getDocumentElement();
    } else {
      source = sourceNode;
    }

    Node node = doc.importNode(source, true);
    doc.appendChild(node);
   
    return doc;
  }
 
View Full Code Here

      source = ((Document) sourceNode).getDocumentElement();
    } else {
      source = sourceNode;
    }

    Node node = doc.importNode(source, true);
    doc.appendChild(node);
   
    return doc;
  }
 
View Full Code Here

         }
         else if (value instanceof org.w3c.dom.Element) {
            // (b) XML Element - mark the type and append a copy of it
            element.setAttribute(AL_TYPE_ATTRIBUTE, "org.w3c.dom.Element");
           
            Node copy = doc.importNode((org.w3c.dom.Element)value, true);
            element.appendChild(copy);
           
            // append the attribute to the attribute-list
            root.appendChild(element);
         }
View Full Code Here

  private void updateJob(Element updatedJob) throws Exception {
    Document jobDocument;
    try{
      jobDocument = converter.getDocBuilder().newDocument();
      jobDocument.appendChild(jobDocument.importNode(updatedJob, true));
    } catch (Exception e){
      throw new Exception("Error creating DOM Document for job: "+e,e);
    }
    if (useDynamicConfiguration){
      updateJobFile(jobDocument);
View Full Code Here

      if (usedNewRunTime && oldRunTime){
        // workaround while <month> Element is not available
        // can later be deleted (keep only else branch)
        usedNewRunTime = false;
        Document runTimeDocument = docBuilder.newDocument();
        runTimeDocument.appendChild(runTimeDocument.importNode(runTimeElement, true));
        StringWriter out = new StringWriter();
        OutputFormat format = new OutputFormat(runTimeDocument);   
        format.setIndenting(true);
        format.setIndent(2);
        format.setOmitXMLDeclaration(true);
View Full Code Here

            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();               
            Document xDoc = docBuilder.newDocument();
            // xDoc.importNode(xNode, true);
            // Element xElem = xDoc.createElement("test");
            // xElem.appendChild(xDoc.importNode(xNode, true));
            xDoc.appendChild(xDoc.importNode(xNode, true));
           
            StringWriter out = new StringWriter();
            XMLSerializer serializer = new XMLSerializer(out, new OutputFormat(xDoc));
            serializer.serialize(xDoc);
            String result = out.toString();
View Full Code Here

        if (node == null) return "";

        DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();               
        DocumentBuilder docBuilder = docFactory.newDocumentBuilder();               
        Document document = docBuilder.newDocument();
        document.appendChild(document.importNode(node, true));
       
        StringWriter out = new StringWriter();
        XMLSerializer serializer = new XMLSerializer(out, new OutputFormat(document));
        serializer.serialize(document);
        return out.toString();
View Full Code Here

        } catch (ParserConfigurationException pcerr) {
            System.out.println ("Could not create document :"  + pcerr);           
            // Have to exit ---
        }             
       
        Element newModel = (Element) doc.importNode(model, true);
        doc.appendChild(newModel);
        Collection modelElements = new Vector ();           
        Element docElem = doc.getDocumentElement();
        modelElements.add(docElem);
        treeview.addModelElements(modelElements);
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.