Java XML Attribute Get getAttributeStringValue(String attribute, NamedNodeMap namedNodeMap)

Here you can find the source of getAttributeStringValue(String attribute, NamedNodeMap namedNodeMap)

Description

get Attribute String Value

License

Open Source License

Declaration

public static String getAttributeStringValue(String attribute, NamedNodeMap namedNodeMap) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class Main {
    public static String getAttributeStringValue(String attribute, NamedNodeMap namedNodeMap) {
        Node node = namedNodeMap.getNamedItem(attribute);
        if (node != null) {
            return node.getTextContent();
        }/*from  w w  w.  j av  a 2  s  . c o  m*/
        return null;
    }
}

Related

  1. getAttributesByName(Node node, ArrayList attrNames)
  2. getAttributesCompact(NamedNodeMap attributes)
  3. getAttributesNamesOf(Element element)
  4. getAttributeString(Node node, String name)
  5. getAttributeStringValue(Node htmlForm, String attributeName, String defaultValue)
  6. getAttributesValues(final StartElement element)
  7. getAttributeTable(Element element)
  8. getAttributeText(final Node node, final String name)
  9. getAttributeTextContent(Node node, String attiribute_name)