Utils.java Source code

Java tutorial

Introduction

Here is the source code for Utils.java

Source

import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class Utils {

    public static Element getFirstChild(Element e, String local) {
        for (Node n = e.getFirstChild(); n != null; n = n.getNextSibling()) {
            if (n.getNodeType() == Node.ELEMENT_NODE) {
                Element c = (Element) n;
                if (c.getLocalName().equals(local))
                    return c;
            }
        }
        return null;
    }

}