get Name Attribute from XML Element - Java XML

Java examples for XML:XML Attribute

Description

get Name Attribute from XML Element

Demo Code


//package com.java2s;

import org.w3c.dom.Element;

public class Main {
    public static final String NAME_ATTR = "name";

    public static String getNameAttr(Element element) {
        return element.getAttribute(NAME_ATTR);
    }/*  ww  w.  j  av a2 s. c om*/
}

Related Tutorials