Android XML Node Child Get getChildElement(Node element, String childNodeName)

Here you can find the source of getChildElement(Node element, String childNodeName)

Description

get Child Element

Declaration

public static Node getChildElement(Node element, String childNodeName) 

Method Source Code

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

public class Main {
    public static Node getChildElement(Node element, String childNodeName) {
        for (int i = 0; i < element.getChildNodes().getLength(); i++) {
            Node child = element.getChildNodes().item(i);
            if (child.getNodeName().equals(childNodeName)) {
                return child;
            }/*from   ww  w.ja  v a  2s  .  c o  m*/
        }

        return null;
    }
}

Related

  1. getChild(Node node, String tag)
  2. getChild(Node node, String tag)
  3. getChild(Node node, String tag)
  4. getChildElement(Node element, String childNodeName)
  5. getChildElementText(Node element, String childNodeName)
  6. getChildElementText(Node element, String childNodeName)
  7. getChildElements(Node node)
  8. getChildElementsByName(Element parent, String name)