Java XML Element Children getSubElement(Element ele, String tagName)

Here you can find the source of getSubElement(Element ele, String tagName)

Description

get Sub Element

License

Apache License

Declaration

public static Element getSubElement(Element ele, String tagName) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import org.w3c.dom.Element;

import org.w3c.dom.NodeList;

public class Main {

    public static Element getSubElement(Element ele, String tagName) {
        NodeList list = ele.getElementsByTagName(tagName);
        if (list.getLength() > 0) {
            return (Element) list.item(0);
        } else//from  w  ww. j  a v  a 2 s  . c om
            return null;
    }
}

Related

  1. clear(Element node, String subElement)
  2. findAll(Element node, String subElement)
  3. getFirstSubElement(Element element)
  4. getImmediateSubElements(Element element, String name)
  5. getRelationUri(Element subject, Element object, String defaultBaseUri)
  6. getSubElement(Element element, String subTagName)
  7. getSubelementBoolean(final Element element, final String element_name, final boolean default_value)
  8. getSubelementDouble(final Element element, final String element_name)
  9. getSubelementDouble(final Element element, final String name, final double default_value)