List of utility methods to do XML Attribute Get
String | getAttribute(String aAttrName, Node aNode) get Attribute return aNode.getAttributes().getNamedItem(aAttrName).getNodeValue();
|
String | getAttribute(String attribute, Node node) get Attribute if (node != null) { Node attr = node.getAttributes().getNamedItem(attribute); if (attr != null) { return attr.getNodeValue().trim(); return null; |
String | getAttribute(String attribute, Node node) get Attribute Node attributeNode = node.getAttributes().getNamedItem(attribute); if (attributeNode != null) return attributeNode.getNodeValue().trim(); return null; |
String | getAttribute(String attribute, Node node) Convenience for accessing an attribute value (the Node interface is rather ugly) NamedNodeMap att = node.getAttributes(); Node w = att.getNamedItem(attribute); if (w == null) return null; return w.getTextContent(); |
String | getAttribute(String key, NamedNodeMap map) Gets the attribute as a string. Node attr = map.getNamedItem(key); return attr != null ? attr.getTextContent() : ""; |
String | getAttribute(String name, Element el) Gets the value of the given DOM element's attribute with the specified name. if (name == null || el == null) return null; if (!el.hasAttribute(name)) return null; return el.getAttribute(name); |
String | getAttribute(String name, Element element) get Attribute return (element.hasAttribute(name) ? element.getAttribute(name) : null);
|
String | getAttribute(String name, Element firstElement, Element secondElement) Try to get an attribute value from two elements. String val = firstElement.getAttribute(name); if (val.length() == 0 && secondElement != null) { val = secondElement.getAttribute(name); return val; |
String | getAttribute(String name, Node node) get Attribute if ((node != null) && (node.getAttributes() != null)) { Node namedItem = node.getAttributes().getNamedItem(name); if (namedItem != null) { return namedItem.getNodeValue(); return null; |
boolean | getAttributeAsBoolean(Element elem, String attribName) Returns attribute as boolean for class String atribVal = elem.getAttribute(attribName); boolean retVal = false; try { retVal = Boolean.valueOf(atribVal).booleanValue(); } catch (Exception e) { return retVal; |