Java XML Node Append appendForeignChild(Node node, Node foreignChild)

Here you can find the source of appendForeignChild(Node node, Node foreignChild)

Description

append Foreign Child

License

Open Source License

Declaration

public static Node appendForeignChild(Node node, Node foreignChild) 

Method Source Code

//package com.java2s;
/*//from ww  w  .  ja va  2  s. c  om
 * JBoss, Home of Professional Open Source
 * Copyright 2005, JBoss Inc., and individual contributors as indicated
 * by the @authors tag.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
 * published by JBoss Inc.; either version 1.0 of the License, or
 * (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */

import org.w3c.dom.Node;

public class Main {
    public static Node appendForeignChild(Node node, Node foreignChild) {
        return node.appendChild(node.getOwnerDocument().importNode(foreignChild, true));
    }
}

Related

  1. addDescendants(Node node, List descendants)
  2. addImageSource(Node test, List holder)
  3. addNodeValue(Node node, String name, boolean value)
  4. addValue(Node node, String value)
  5. appendChild(Node parent, Node child)
  6. canAppend(Node node, Node parentNode)