Java XML Element Get by Name getFirstElementByName(String name, Element parent)

Here you can find the source of getFirstElementByName(String name, Element parent)

Description

get First Element By Name

License

Open Source License

Declaration

public static Element getFirstElementByName(String name, Element parent) 

Method Source Code


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

import org.w3c.dom.Element;

public class Main {
    public static Element getFirstElementByName(String name, Element parent) {
        return (Element) parent.getElementsByTagName(name).item(0);
    }/* w w  w.j a v  a2 s .co  m*/
}

Related

  1. getElementValue(Element parent, String tagName)
  2. getElementValue(Element parent, String tagName)
  3. getFirstElement(Element parent, String name)
  4. getFirstElementAtAnyDepthByNodeName(Element parent, String name)
  5. getFirstElementByName(Element parent, String name)
  6. getFirstElementByTagName(Element parent, String tagName)
  7. getGrandSonElementByTagName(Element element, String parentName, String eleName)
  8. getGrandSonElementsByTagName(Element ele, String parentName, String eleName)
  9. getGrandSonElementValueByTagName(Element element, String parentName, String eleName)