Java XML Element Children getSubElement(Element element, String subTagName)

Here you can find the source of getSubElement(Element element, String subTagName)

Description

get Sub Element

License

Apache License

Declaration

public static String getSubElement(Element element, String subTagName) 

Method Source Code

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

import org.w3c.dom.Element;

public class Main {
    public static String getSubElement(Element element, String subTagName, int itemId) {
        return element.getElementsByTagName(subTagName).item(itemId).getTextContent();
    }/*from   w  w  w . j  a  va 2s .c  om*/

    public static String getSubElement(Element element, String subTagName) {
        return getSubElement(element, subTagName, 0);
    }
}

Related

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