Package org.w3c.dom

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


        secHeader.insertSecurityHeader(doc);
        Document signedDoc = builder.build(doc, crypto, secHeader);
       
        // Add a comment node as the first node element
        org.w3c.dom.Node firstChild = signedDoc.getFirstChild();
        org.w3c.dom.Node newNode = signedDoc.removeChild(firstChild);
        org.w3c.dom.Node commentNode = signedDoc.createComment("This is a comment");
        signedDoc.appendChild(commentNode);
        signedDoc.appendChild(newNode);

        if (LOG.isDebugEnabled()) {
View Full Code Here


    public static Document toDocumentWithoutDTD(InputStream in) throws Exception {
        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(in);
        DocumentType docType = doc.getDoctype();
        if (docType != null) {
            doc.removeChild(docType);
        }
        return doc;
    }
}
View Full Code Here

    protected void addPartValue(Element element, String name, Object value) {
        if (value instanceof Document) {
            Document doc = (Document) value;
            Element root = doc.getDocumentElement();
            doc.removeChild(root);
            element.appendChild(root);
        }
        else if (value != null) {
            String text = value.toString();
            element.appendChild(element.getOwnerDocument().createTextNode(text));
View Full Code Here

        // we need to create a new one and remove the old
        //                 
        Document document = doctype.getOwnerDocument();
        DocumentType newDoctype = createDoctype(dialog, document);
        document.insertBefore(newDoctype, doctype);
        document.removeChild(doctype);
        // manager.reformat(newDoctype, false);
      }
    }
  }
}
View Full Code Here

            Node slave = slaves.item(i);
            String id = XMLTools.getAttribute("id", slave);
            int sId = Integer.valueOf(id);
            if(sId!=idSrc)
            {
                doc.removeChild(slave);
            }
        }
        ModbusPalProject.optimize(doc,false);

        boolean importBindings = dialog.importBindings();
View Full Code Here

        secHeader.insertSecurityHeader(doc);
        Document signedDoc = builder.build(doc, crypto, secHeader);
       
        // Add a comment node as the first node element
        org.w3c.dom.Node firstChild = signedDoc.getFirstChild();
        org.w3c.dom.Node newNode = signedDoc.removeChild(firstChild);
        org.w3c.dom.Node commentNode = signedDoc.createComment("This is a comment");
        signedDoc.appendChild(commentNode);
        signedDoc.appendChild(newNode);

        if (LOG.isDebugEnabled()) {
View Full Code Here

        Node child = doc.getFirstChild();
        Node next = null;
        while (child != null) {
            next = child.getNextSibling();
            if (child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) {
                doc.removeChild(child);
            }
            child = next;
        }

        //
View Full Code Here

                } catch (TransformerConfigurationException e) {
                    throw new SAXException("Error creating a new TransformerHandler", e);
                }
                Document doc = domImplementation.createDocument(uri, qName, null);
                //It's easier to work with an empty document, so remove the root element
                doc.removeChild(doc.getDocumentElement());
                handler.setResult(new DOMResult(doc));
                Area parent = (Area)areaStack.peek();
                ((ForeignObject)parent).setDocument(doc);

                //activate delegate for nested foreign document
View Full Code Here

        secHeader.insertSecurityHeader(doc);
        Document signedDoc = builder.build(doc, crypto, secHeader);
       
        // Add a comment node as the first node element
        org.w3c.dom.Node firstChild = signedDoc.getFirstChild();
        org.w3c.dom.Node newNode = signedDoc.removeChild(firstChild);
        org.w3c.dom.Node commentNode = signedDoc.createComment("This is a comment");
        signedDoc.appendChild(commentNode);
        signedDoc.appendChild(newNode);

        if (LOG.isDebugEnabled()) {
View Full Code Here

     * @return org.w3c.dom.Document The clone document
     * @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(this.document.getDocumentElement(), true));

        return documentClone;
    }
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.