Java XML Child Element Attribute getChildAttributNode(Node node)

Here you can find the source of getChildAttributNode(Node node)

Description

get Child Attribut Node

License

Open Source License

Declaration

public static List<Node> getChildAttributNode(Node node) 

Method Source Code

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

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.Node;

public class Main {
    public static String ATTRIBUT = "rng:attribute";

    public static List<Node> getChildAttributNode(Node node) {
        List<Node> nodes = new ArrayList<Node>();

        for (int i = 0; i < node.getChildNodes().getLength(); i++) {
            Node n = node.getChildNodes().item(i);
            if (n.getNodeName().equals(ATTRIBUT)) {
                nodes.add(n);/*from  ww w  .jav a2  s.  c om*/
            }
        }

        return nodes;
    }
}

Related

  1. getChildAttribute(Element root, String childName, String attName)
  2. getChildAttribute(Node n, String childName, String attribute)