Here you can find the source of GetNodeAttribute(Node node, String attributeName)
Parameter | Description |
---|---|
node | The node containing the desired attribute. |
attributeName | The name of the desired attribute. |
public static String GetNodeAttribute(Node node, String attributeName)
//package com.java2s; /*/*from ww w.j a v a 2 s .c o m*/ * JLib - Publicitas Java library. * * Copyright (c) 2005, 2006, 2007, 2008 Publicitas SA. * Licensed under LGPL (LGPL-LICENSE.txt) license. */ import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { /** * Returns the content of the specified attribute in the specified node. * @param node The node containing the desired attribute. * @param attributeName The name of the desired attribute. * @return The text of the specified attribute. If the attribute doesn't exist * in the specified node, the method returns an empty string. */ public static String GetNodeAttribute(Node node, String attributeName) { Element x = (Element) node; return x.getAttribute(attributeName); } }