Java tutorial
//package com.java2s; //License from project: Apache License import org.w3c.dom.Node; public class Main { /** * Insert the method's description here. * * @return java.lang.String * @param element * org.w3c.dom.Node * @param attributeName * java.lang.String */ public static String getNodeAttributeValue(Node element, String attributeName) { Node tmpNode = element.getAttributes().getNamedItem(attributeName); String tmp = null; if (tmpNode != null) tmp = tmpNode.getNodeValue(); return tmp; } }