Java XML Attribute Get getAttribute(Element element, String name)

Here you can find the source of getAttribute(Element element, String name)

Description

get Attribute

License

Open Source License

Declaration

public static String getAttribute(Element element, String name) 

Method Source Code

//package com.java2s;
import org.w3c.dom.*;

public class Main {
    public static String getAttribute(Element element, String name) {
        Attr attr = element.getAttributeNode(name);
        return (attr != null) ? attr.getValue() : null;
    }//from   www. ja va  2 s .c o m

    public static Node getAttribute(Node node, String name) {
        return node.getAttributes().getNamedItem(name);
    }
}

Related

  1. getAttribute(Element element, String attributeName)
  2. getAttribute(Element element, String attributeName)
  3. getAttribute(Element element, String attributeName, float deflt)
  4. getAttribute(Element element, String attrName)
  5. getAttribute(Element element, String name)
  6. getAttribute(Element element, String name)
  7. getAttribute(Element element, String name)
  8. getAttribute(Element element, String name, String defaultVal)
  9. getAttribute(Element element, String namespace, String name)