import XML Document To Node - Java XML

Java examples for XML:XML Node Operation

Description

import XML Document To Node

Demo Code


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

public class Main {
    public static Node importDocumentToNode(Node nodeOutput,
            Document docInput) {/*from  ww  w. j  a  va 2s. c  o  m*/

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

Related Tutorials