Java examples for XML:XML Attribute
get Attribute from XML Node by attribute name
//package com.java2s; import org.w3c.dom.Node; public class Main { public static String getAttribute(Node node, String name) { if (node == null) { return null; }// w ww . jav a2 s.c om Node val = node.getAttributes().getNamedItem(name); if (val == null) { return null; } return val.getNodeValue(); } }