Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class Main {
    public static Element addElementBefore(Document doc, Element sibling, String nodeName) {
        Element el = null;
        if (doc != null)
            el = doc.createElement(nodeName);

        if (sibling != null)
            sibling.getParentNode().insertBefore(el, sibling);

        return el;
    }
}