Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/* Copyright 2004 - 2007 Kasper Nielsen <kasper@codehaus.org> Licensed under
 * the Apache 2.0 License, see http://coconut.codehaus.org/license.
 */

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.Element;

public class Main {
    public static List<Element> getChildren(String name, Element e) {
        List<Element> result = new ArrayList<Element>();
        if (e != null) {
            for (int i = 0; i < e.getChildNodes().getLength(); i++) {
                if (e.getChildNodes().item(i).getNodeName().equals(name)) {
                    result.add((Element) e.getChildNodes().item(i));
                }
            }
        }
        return result;
    }
}