Java XML Attribute Get getAttribute(NamedNodeMap namedNodeMap, String name)

Here you can find the source of getAttribute(NamedNodeMap namedNodeMap, String name)

Description

get Attribute

License

Apache License

Declaration

public static String getAttribute(NamedNodeMap namedNodeMap, String name) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static String getAttribute(NamedNodeMap namedNodeMap, String name) {
        Node node = namedNodeMap.getNamedItem(name);
        if (node == null) {
            return null;
        }//from www  . ja  v  a2s.c  o  m
        return node.getNodeValue();
    }
}

Related

  1. getAttribute(final Node node, final String attribname, final int def)
  2. getAttribute(final Node node, final String attributeName)
  3. getAttribute(final Node node, final String name)
  4. getAttribute(final Node xml, final String namespaceURI, final String localName)
  5. getAttribute(NamedNodeMap map, String name)
  6. getAttribute(NamedNodeMap ruleAttributes, String attributeName)
  7. getAttribute(Node aNode, String attributeName)
  8. getAttribute(Node attrNode)
  9. getAttribute(Node currentNode, String attributeName)