Here you can find the source of getAttribute(Node currentNode, String attributeName)
Parameter | Description |
---|---|
currentNode | a parameter |
attributeName | a parameter |
public static String getAttribute(Node currentNode, String attributeName)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { /**/*w w w. j av a 2s .com*/ * Gets the attribute value for a Node given the attribute name * * @param currentNode * @param attributeName * @return the attribute value */ public static String getAttribute(Node currentNode, String attributeName) { NamedNodeMap attrs = currentNode.getAttributes(); return attrs.getNamedItem(attributeName).getNodeValue().trim(); } }