import XML Node To Document - Java XML

Java examples for XML:XML Node Operation

Description

import XML Node To Document

Demo Code


//package com.java2s;
import org.w3c.dom.Document;
import org.w3c.dom.Node;

public class Main {
    public static Document importNodeToDocument(Document docOutput,
            Node nodeInput) {/*from   w w w . ja v  a2s  .c om*/

        Node nodeImported = docOutput.importNode(nodeInput, true);
        docOutput.getDocumentElement().appendChild(nodeImported);
        return docOutput;
    }
}

Related Tutorials