get XML Node Attribute Value - Java XML

Java examples for XML:XML Attribute

Description

get XML Node Attribute Value

Demo Code


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

public class Main {
    public static String getNodeAttributeValue(Node node,
            String attributeName) {
        return ((Element) node).getAttribute(attributeName);
    }/*from   www  .j ava 2  s  . com*/
}

Related Tutorials