import XML Document To Document - Java XML

Java examples for XML:DOM Document

Description

import XML Document To Document

Demo Code


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

public class Main {
    public static Document importDocumentToDocument(Document docOutput,
            Document docInput) {//  w w w.  j a  v a  2  s.  co m

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

Related Tutorials