Here you can find the source of insertAfter(Node refNode, Node newNode)
Parameter | Description |
---|---|
refNode | The reference node. New node will be inserted after this one. |
newNode | The new node to be inserted. |
public static void insertAfter(Node refNode, Node newNode)
//package com.java2s; /*// w w w . j av a 2 s .com * This file is released under terms of BSD license * See LICENSE file for more information */ import org.w3c.dom.Node; public class Main { /** * Insert a node directly after a reference node. * * @param refNode The reference node. New node will be inserted after this * one. * @param newNode The new node to be inserted. */ public static void insertAfter(Node refNode, Node newNode) { refNode.getParentNode().insertBefore(newNode, refNode.getNextSibling()); } }