Get the value of the XML attribute of the element - Android XML

Android examples for XML:XML Attribute

Description

Get the value of the XML attribute of the element

Demo Code


//package com.java2s;

import org.w3c.dom.Element;

public class Main {
    /**//from w w w .  j a v a 2  s.  c o  m
     * Get the value of the attribute of the element
     *
     * @param element
     * @param attr
     * @return
     */
    public static String getElementAttr(Element element, String attr) {
        return element.getAttribute(attr);
    }
}

Related Tutorials