Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    /**gets the sibling element of a node
     * @param start the node to get the sibling of
     * @return the sibling node*/
    public static Node GetNextSiblingElement(Node start) {
        if (start == null)
            return start;
        Node node = start.getNextSibling();
        if (node == null)
            return node;
        else if (node.getNodeType() != Node.ELEMENT_NODE)
            return GetNextSiblingElement(node);
        else
            return node;
    }
}