Android Utililty Methods XML Node Attribute Get

List of utility methods to do XML Node Attribute Get

Description

The list of methods to do XML Node Attribute Get are organized into topic(s).

Method

StringgetNodeAttribute(Node node, String name)
get Node Attribute
return getNamedItemNodeValue(node.getAttributes(), name, null);
StringgetNodeAttribute(Node node, String name, String def)
get Node Attribute
return getNamedItemNodeValue(node.getAttributes(), name, def);
booleannodeMatchesAttributeFilter(Node node, String attributeName, List attributeValues)
node Matches Attribute Filter
if (attributeName == null || attributeValues == null) {
    return true;
NamedNodeMap attrMap = node.getAttributes();
if (attrMap != null) {
    Node attrNode = attrMap.getNamedItem(attributeName);
    if (attrNode != null
            && attributeValues.contains(attrNode.getNodeValue())) {
...
ElementfindNextElementWithAttribute(Node ret, String name, String attribute, String value)
find Next Element With Attribute
ret = ret.getNextSibling();
while (ret != null
        && (!(ret instanceof Element)
                || !ret.getNodeName().equals(name)
                || ((Element) ret).getAttribute(attribute) == null || !((Element) ret)
                .getAttribute(attribute).equals(value))) {
    ret = ret.getNextSibling();
return (Element) ret;