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

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) {
        Node n = node.getAttributes().getNamedItem(attributeName);
        if (n != null) {
            return n.getNodeValue();
        } else {//from w  ww  .  j a va2s . c o m
            return null;
        }
    }
}

Related

  1. getAttribute(Node node, String attribute)
  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)
  7. getAttribute(Node node, String attributeName)
  8. getAttribute(Node node, String attributeName)
  9. getAttribute(Node node, String attributeName, String defaultValue)