Java XML Node Insert insertBefore(Node currentNode, Node insertNode)

Here you can find the source of insertBefore(Node currentNode, Node insertNode)

Description

insert Before

License

Open Source License

Declaration

public static void insertBefore(Node currentNode, Node insertNode) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Educational Online Test Delivery System Copyright (c) 2014 American
 * Institutes for Research/*from www .  j a  v a  2s  . c o  m*/
 * 
 * Distributed under the AIR Open Source License, Version 1.0 See accompanying
 * file AIR-License-1_0.txt or at http://www.smarterapp.org/documents/
 * American_Institutes_for_Research_Open_Source_Software_License.pdf
 ******************************************************************************/

import org.w3c.dom.Node;

public class Main {
    public static void insertBefore(Node currentNode, Node insertNode) {
        currentNode.getParentNode().insertBefore(insertNode, currentNode);
    }
}

Related

  1. insertAfter(Node newNode, Node refNode)
  2. insertAfter(Node refNode, Node newNode)