Android XML Element Attribute Get getNodeAttrValue(Element parent, String nodeName, String attrName)

Here you can find the source of getNodeAttrValue(Element parent, String nodeName, String attrName)

Description

get Node Attr Value

License

Open Source License

Declaration

public static String getNodeAttrValue(Element parent, String nodeName,
            String attrName) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Element;

public class Main {
    public static String getNodeAttrValue(Element parent, String nodeName,
            String attrName) {/*  www  .j a v  a2  s. c  o  m*/
        try {
            return ((Element) parent.getElementsByTagName(nodeName).item(0))
                    .getAttribute(attrName);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. getAttributeValue(Element elem, String name)
  2. getBooleanAttribute(Element el, String name)
  3. getIntAttribute(Element el, String name)
  4. processAnyAttributes(Element element, Map anyAttributes)