Here you can find the source of getAttributeValue(Node node, String attributeName)
Parameter | Description |
---|---|
node | the node |
attributeName | the name of the attribute |
public static String getAttributeValue(Node node, String attributeName)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; public class Main { /**//from w w w . ja v a2 s .co m * Get the attribute value of the node. * * @param node * the node * @param attributeName * the name of the attribute * @return the value of the attribute */ public static String getAttributeValue(Node node, String attributeName) { Node attribute = node.getAttributes().getNamedItem(attributeName); if (attribute != null) { return attribute.getNodeValue(); } else { return null; } } }