Here you can find the source of getAttribute(Node node, String localName, String namespaceURI)
public static String getAttribute(Node node, String localName, String namespaceURI)
//package com.java2s; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { public static String getAttribute(Node node, String name) { NamedNodeMap attributes = node.getAttributes(); if (attributes == null) { return null; }/* w w w.jav a 2 s .co m*/ Node attributeNode = node.getAttributes().getNamedItem(name); if (attributeNode == null) { return null; } return attributeNode.getTextContent(); } public static String getAttribute(Node node, String localName, String namespaceURI) { Node attributeNode = node.getAttributes().getNamedItemNS(namespaceURI, localName); if (attributeNode == null) { return null; } return attributeNode.getTextContent(); } }