Android XML Element Child Get findChildElement(Element parent, String name)

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

Description

find Child Element

Declaration

public static Element findChildElement(Element parent, String name) 

Method Source Code

//package com.java2s;
import org.w3c.dom.Element;

public class Main {
    public static Element findChildElement(Element parent, String name) {
        if (parent == null) {
            return null;
        }//from   ww w . j  a  v  a 2s.c  om
        org.w3c.dom.Node ret = parent.getFirstChild();
        while (ret != null
                && (!(ret instanceof Element) || !ret.getNodeName().equals(
                        name))) {
            ret = ret.getNextSibling();
        }
        return (Element) ret;
    }
}

Related

  1. findChild(Element parent, String tagName)
  2. findChildElementWithAttribute(Element parent, String name, String attribute, String value)
  3. findChildren(Element parent, String tagName)
  4. findFirstChildElement(Element parent)
  5. firstChildWithName(Element element, String name)