Here you can find the source of insertAfter(Node newChild, Node refChild)
Parameter | Description |
---|---|
newChild | __UNDOCUMENTED__ |
refChild | __UNDOCUMENTED__ |
Parameter | Description |
---|---|
DOMException | __UNDOCUMENTED__ |
public static void insertAfter(Node newChild, Node refChild) throws DOMException
//package com.java2s; /*//w ww.ja va 2 s . c om * Copyright (c) 2012. betterFORM Project - http://www.betterform.de * Licensed under the terms of BSD License */ import org.w3c.dom.*; public class Main { /** * __UNDOCUMENTED__ * * @param newChild __UNDOCUMENTED__ * @param refChild __UNDOCUMENTED__ * @throws DOMException __UNDOCUMENTED__ */ public static void insertAfter(Node newChild, Node refChild) throws DOMException { if (refChild == null) { throw new DOMException(DOMException.NOT_FOUND_ERR, "refChild == null"); } Node nextSibling = refChild.getNextSibling(); if (nextSibling == null) { refChild.getParentNode().appendChild(newChild); } else { refChild.getParentNode().insertBefore(newChild, nextSibling); } } }