List of utility methods to do XML Attribute from Node
String | getNodeAttribute(Node node, String s) get Node Attribute NamedNodeMap attributes = node.getAttributes(); for (int k = 0; k < attributes.getLength(); k++) { Node nodeAttr = attributes.item(k); if (nodeAttr.getNodeName().equals(s)) { return nodeAttr.getNodeValue(); return null; ... |
String | getNodeAttribute(Node QueryNode, String AttrName) return an attruibte value from a Node NamedNodeMap attrs = QueryNode.getAttributes(); if (attrs == null) return (null); Node Value = attrs.getNamedItem(AttrName); if (Value == null) return (null); return (Value.getNodeValue()); |
String | getNodeAttribute(Node thisNode, String key) Utility method to look for any key=value attribute for a Node and returns null if the attribute does not exist or contains the empty string. if (null == thisNode) { return null; NamedNodeMap attributes = thisNode.getAttributes(); if (null == attributes) { return null; Node node = attributes.getNamedItem(key); ... |
int | getNodeAttributeAsInt(Node node, String attributeName, int defaultValue) get Node Attribute As Int String s = getNodeAttribute(node, attributeName); if (null == s) { return defaultValue; } else { return convertToInt(attributeName, s); |
String | getNodeAttributeDeep(NodeList nodelList, String nodeName, String nodeAttr) get Node Attribute Deep for (int i = 0; i < nodelList.getLength(); i++) { Node node = nodelList.item(i); if (node.getNodeName().equals(nodeName)) { return getNodeAttribute(node, nodeAttr); if (node.getChildNodes().getLength() > 0) { String result = getNodeAttributeDeep(node.getChildNodes(), nodeName, nodeAttr); if (result != null) ... |
Comparable | getNodeAttributes(final Node node) get Node Attributes return new Comparable[] { Short.valueOf(node.getNodeType()), node.getNodeName(), node.getLocalName(), node.getNamespaceURI(), node.getPrefix(), node.getNodeValue() }; |
String | getNodeAttributesToString(Node node) Returns in a String the attributes and values of the node. String atributos = ""; String coma = ""; for (int j = 0; j < node.getAttributes().getLength(); j++) { Node atributo = node.getAttributes().item(j); atributos = atributos + coma + atributo.toString(); coma = " ; "; return atributos; ... |
String | getNodeAttributeValue(Node element, String attributeName) Insert the method's description here. Node tmpNode = element.getAttributes().getNamedItem(attributeName); String tmp = null; if (tmpNode != null) tmp = tmpNode.getNodeValue(); return tmp; |
String | getNodeAttributeValue(Node node, String attribute) get Node Attribute Value String value = null; NamedNodeMap attributes = node.getAttributes(); Node valueNode = attributes.getNamedItem(attribute); if (valueNode != null) value = valueNode.getNodeValue(); return value; |
String | getNodeAttributeValue(Node node, String attributeName) get Node Attribute Value NamedNodeMap attributes = node.getAttributes(); if (attributes == null) return null; Node attributeValue = attributes.getNamedItem(attributeName); return attributeValue == null ? null : attributeValue.getNodeValue(); |