Java Utililty Methods XML Child Element Attribute

List of utility methods to do XML Child Element Attribute

Description

The list of methods to do XML Child Element Attribute are organized into topic(s).

Method

StringgetChildAttribute(Element root, String childName, String attName)
Returns a particular attribute value of a specified child of an element.
try {
    return getChildAttribute(root, childName, attName, false);
} catch (Exception e) {
    return null;
StringgetChildAttribute(Node n, String childName, String attribute)
Reads a single attribute of a single child node
Node c = getSingleChild(n, childName);
return c.getAttributes().getNamedItem(attribute).getNodeValue();
ListgetChildAttributNode(Node node)
get Child Attribut 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);
return nodes;
...