Here you can find the source of getAttribute(Node node, String attr)
public static Node getAttribute(Node node, String attr)
//package com.java2s; /*/*from www. ja v a 2s . c o m*/ * Copyright 2013 Carnegie Mellon University * * Any opinions, findings and conclusions or recommendations expressed in this * Material are those of the author(s) and do not necessarily reflect the * views of the United States Department of Defense. * NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING * INSTITUTE MATERIAL IS FURNISHED ON AN ?AS-IS? BASIS. CARNEGIE MELLON * UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, * AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR * PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF * THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF * ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT * INFRINGEMENT. * * This Material has been approved for public release and unlimited * distribution except as restricted below. * * This Material is provided to you under the terms and conditions of the * Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is * provided with this Content and is also available at * http://www.eclipse.org/legal/epl-v10.html. * * Carnegie Mellon is registered in the U.S. Patent and Trademark * Office by Carnegie Mellon University. * */ import org.w3c.dom.Node; public class Main { public static Node getAttribute(Node node, String attr) { return node.getAttributes().getNamedItem(attr); } }