Here you can find the source of getAttributeValue(Node node, String attribute)
public static String getAttributeValue(Node node, String attribute)
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 Pivotal Software, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://ww w .j a va2s .co m * Pivotal Software, Inc. - initial API and implementation *******************************************************************************/ import org.w3c.dom.Node; public class Main { public static String getAttributeValue(Node node, String attribute) { Node item = node.getAttributes().getNamedItem(attribute); return (item != null) ? item.getNodeValue() : null; } }