Here you can find the source of getAttribute(Node node, String name)
public static Object getAttribute(Node node, String name)
//package com.java2s; /*/*w ww .ja v a2 s . co m*/ * ImageI/O-Ext - OpenSource Java Image translation Library * http://www.geo-solutions.it/ * http://java.net/projects/imageio-ext/ * (C) 2007 - 2009, GeoSolutions * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * either version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { /** Extracts the value of the attribute from name. */ public static Object getAttribute(Node node, String name) { NamedNodeMap map = node.getAttributes(); node = map.getNamedItem(name); return (node != null) ? node.getNodeValue() : null; } }