get Attribute from XML Element by name - Android XML

Android examples for XML:XML Attribute

Description

get Attribute from XML Element by name

Demo Code


//package com.java2s;
import org.w3c.dom.Element;

public class Main {
    public static String getAttribute(Element e, String name) {
        if (e.getAttribute(name) == null)
            return "";
        return e.getAttribute(name);
    }/*from  ww w.  j a v  a 2s  .c  o  m*/
}

Related Tutorials