Java XML Child Node Get getChildNodes(final Node node)

Here you can find the source of getChildNodes(final Node node)

Description

get Child Nodes

License

Open Source License

Declaration

public static List<Node> getChildNodes(final Node node) 

Method Source Code

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

import java.util.List;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import com.google.common.collect.Lists;

public class Main {
    public static List<Node> getChildNodes(final Node node) {
        final NodeList list = node.getChildNodes();
        final List<Node> result = Lists.newArrayList();

        for (int i = 0; i < list.getLength(); i++) {
            final Node child = list.item(i);
            result.add(child);/*from w  ww . j  av  a 2 s. c o m*/
        }

        return result;
    }
}

Related

  1. getChildNodeByTagName(Node node, String name)
  2. getChildNodeByType(Element element, short nodeType)
  3. getChildNodeGentle(Node node, String namespace, String localname)
  4. getChildNodeListByTagName(Element parent, String tagName)
  5. getChildNodes(Element ele)
  6. getChildNodes(final Node node, final short nodetype)
  7. getChildNodes(final Node node, final String attributeName, final String value)
  8. getChildNodes(final Node node, short... types)
  9. getChildNodes(final Node parent, boolean recursiveSearch, final String... nodeNames)