Here you can find the source of getAttributeAsString(NamedNodeMap attributes, String name)
Parameter | Description |
---|---|
attributes | Attributes node |
name | Name of the attribute |
public static String getAttributeAsString(NamedNodeMap attributes, String name)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Attr; import org.w3c.dom.NamedNodeMap; public class Main { /**/*from ww w. j a v a 2 s .c o m*/ * Get an attribute's value and return an empty string, of the attribute is * not specified * * @param attributes * Attributes node * @param name * Name of the attribute * @return Attributes value */ public static String getAttributeAsString(NamedNodeMap attributes, String name) { Attr attribute; String value = ""; //$NON-NLS-1$ attribute = (Attr) attributes.getNamedItem(name); if (attribute != null) { value = attribute.getValue(); } return value; } }