Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.Vector;

import org.w3c.dom.Element;

import org.w3c.dom.NodeList;

public class Main {
    public static Vector<Element> extractElementList(Element elem, String name) {
        NodeList nl = elem.getElementsByTagName(name);
        Vector<Element> values = new Vector<Element>(nl.getLength());
        for (int n = 0; n < nl.getLength(); n++) {
            Element element = (Element) nl.item(n);
            if (element != null)
                values.addElement(element);
        }
        return values;
    }
}