Java XML Attribute Get getAttribute(Node node, String attributeName)

Here you can find the source of getAttribute(Node node, String attributeName)

Description

get Attribute

License

Open Source License

Parameter

Parameter Description
node a parameter
attributeName a parameter

Declaration

public static String getAttribute(Node node, String attributeName) 

Method Source Code

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

import org.w3c.dom.Node;

public class Main {

    public static String getAttribute(Node node, String attributeName) {
        String attributeValue = null;

        if (node.getAttributes().getNamedItem(attributeName) != null) {
            attributeValue = node.getAttributes().getNamedItem(attributeName).getNodeValue();
        }/* w w w.j a va 2s .  c om*/

        return attributeValue;
    }
}

Related

  1. getAttribute(Node node, String attributeName)
  2. getAttribute(Node node, String attributeName)
  3. getAttribute(Node node, String attributeName)
  4. getAttribute(Node node, String attributeName)
  5. getAttribute(Node node, String attributeName)
  6. getAttribute(Node node, String attributeName, String defaultValue)
  7. getAttribute(Node node, String attrName)
  8. getAttribute(Node node, String localName, String namespaceURI)
  9. getAttribute(Node node, String localName, String namespaceURI)