Here you can find the source of getAttribute(Node node, String name)
public static String getAttribute(Node node, String name)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one 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(); Node attrNode = attributes.getNamedItem(name); if (attrNode != null) return attrNode.getNodeValue(); return null; }/* www .java2 s . c om*/ }