The list of methods to do XML Attribute Get are organized into topic(s).
String
getAttr(Element e, String name) get Attr
String value = e.getAttribute(name);
return ((value == null || value.trim().length() <= 0) ? null : value.trim());
String
getAttr(final Node n, final String attrName) Gives the value of a given attribute
String value = null;
if (n.hasAttributes()) {
final NamedNodeMap map = n.getAttributes();
for (int i = 0; i < map.getLength(); i++) {
final Node attrNode = map.item(i);
if (attrNode.getNodeName().equals(attrName)) {
value = attrNode.getNodeValue();
return value;
String
getAttr(NamedNodeMap attrs, String name, String missing_err) get Attr
Node attr = attrs == null ? null : attrs.getNamedItem(name);
if (attr == null) {
if (missing_err == null)
return null;
throw new RuntimeException(missing_err + ": missing mandatory attribute '" + name + "'");
String val = attr.getNodeValue();
return val;
...
String
getAttr(Node n, String name) get Attr
if (n == null)
return null;
Node nn = n.getAttributes().getNamedItem(name);
if (nn != null)
return nn.getNodeValue();
return null;
String
getAttr(Node node, String attr) get Attr
final NamedNodeMap attributes = node.getAttributes();
final Node nodeAttr = attributes.getNamedItem(attr);
if (nodeAttr != null) {
return nodeAttr.getTextContent();
return null;
String
getAttr(Node node, String name) get Attr
assert node != null;
try {
NamedNodeMap attributes = node.getAttributes();
if (attributes == null)
throw new Exception("");
Node attr = attributes.getNamedItem(name);
if (attr == null)
throw new Exception("");
...