List of utility methods to do XML Child Element Attribute
String | getChildAttribute(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; |
String | getChildAttribute(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();
|
List | getChildAttributNode(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; ... |