Java XML First Child Element getFirstChildElement(Element parent, String childName)

Here you can find the source of getFirstChildElement(Element parent, String childName)

Description

get First Child Element

License

Open Source License

Declaration

public static Element getFirstChildElement(Element parent, String childName) 

Method Source Code

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

import org.w3c.dom.Element;

public class Main {
    public static Element getFirstChildElement(Element parent, String childName) {
        if (parent.getElementsByTagName(childName).getLength() > 0) {
            return (Element) parent.getElementsByTagName(childName).item(0);
        }//  w ww.  j  a  v a 2s. c om
        return null;
    }
}

Related

  1. getFirstChildElement(Element elm, String name)
  2. getFirstChildElement(Element elm, String name)
  3. getFirstChildElement(Element parent)
  4. getFirstChildElement(Element parent)
  5. getFirstChildElement(Element parent)
  6. getFirstChildElement(Element parent, String nsUri, String localPart)
  7. getFirstChildElement(Element parent, String tagName)
  8. getFirstChildElement(Element parent, String tagName)
  9. getFirstChildElement(Element parentElem)