List of utility methods to do XML Attribute Get
String | getAttribute(Node n, String attr) get Attribute Node nn = n.getAttributes().getNamedItem(attr); if (nn == null) return null; return nn.getNodeValue(); |
String | getAttribute(Node n, String attr, String def) get Attribute NamedNodeMap attrs = n.getAttributes(); if (attrs == null) return def; Node ret = attrs.getNamedItem(attr); if (ret == null) return def; else return ret.getNodeValue(); ... |
String | getAttribute(Node n, String name) get Attribute if (n == null || name == null) return null; if (n instanceof Element) return ((Element) n).getAttribute(name); return null; |
String | getAttribute(Node node, String att_name) Return the value of an attribute of a node or an empty string if the attribute is not present. if (node == null) return ""; return getText(node.getAttributes().getNamedItem(att_name)); |
String | getAttribute(Node node, String attName, boolean domLevel3) get Attribute final Node attNode = node.getAttributes().getNamedItem(attName); if (attNode == null) { return null; return getTextContent(attNode, domLevel3); |
Node | getAttribute(Node node, String attr) get Attribute return node.getAttributes().getNamedItem(attr);
|
String | getAttribute(Node node, String attr) Gets a named attribute of a Node
if (node == null) throw new IllegalArgumentException("Node argument cannot be null"); if (attr == null) throw new IllegalArgumentException("Node attribute argument cannot be null"); NamedNodeMap map = node.getAttributes(); if (map != null) { Node an = map.getNamedItem(attr); if (an != null) ... |
Node | getAttribute(Node node, String attr) Get the value of a specific attribute on an XML node return node.getAttributes().getNamedItem(attr);
|
String | getAttribute(Node node, String attr) get Attribute return getAttribute(node, attr, null);
|
String | getAttribute(Node node, String attribName) get the value for an attribute. String attributeVal = getAttribute(node, attribName, null); assert (attributeVal != null) : "no attribute named '" + attribName + "' for node '" + node.getNodeName() + "' val=" + node.getNodeValue(); return attributeVal; |