Android XML Node Attribute Get getAttrOfName(Node node, String string)

Here you can find the source of getAttrOfName(Node node, String string)

Description

get Attr Of Name

Declaration

public static String getAttrOfName(Node node, String string) 

Method Source Code

//package com.java2s;

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class Main {
    public static String getAttrOfName(Node node, String string) {
        NamedNodeMap attributes = node.getAttributes();
        Node namedItem = attributes.getNamedItem(string);
        if (namedItem == null) {
            return null;
        }//from w  w  w . j a va2 s  .co m
        return namedItem.getNodeValue();
    }
}

Related

  1. getAttribute(Node node, String name)
  2. getAttributeValue(Node node, String attributeName)
  3. getAttributeValue(Node node, String attributeName)
  4. getAttributeValueAsInt(Node node, String attributeName)