Java Utililty Methods XML Attribute Get

List of utility methods to do XML Attribute Get

Description

The list of methods to do XML Attribute Get are organized into topic(s).

Method

StringgetAttribute(Element element, String attributeName)
get Attribute
return (element.hasAttribute(attributeName) ? element.getAttribute(attributeName) : null);
floatgetAttribute(Element element, String attributeName, float deflt)
get Attribute
String result = element.getAttribute(attributeName);
return (result == null) || ("".equals(result)) ? deflt : Float.parseFloat(result);
StringgetAttribute(Element element, String attrName)
get Attribute
if (!element.hasAttribute(attrName)) {
    String localName = getLocalName(attrName);
    if (!attrName.equals(localName))
        return getAttribute(element, localName);
    return null;
return element.getAttribute(attrName);
StringgetAttribute(Element element, String name)
get Attribute
Attr attr = element.getAttributeNode(name);
return (attr != null) ? attr.getValue() : null;
StringgetAttribute(Element element, String name)
get Attribute
String value = element.getAttribute(name);
String safeValue = value.replace((CharSequence) "::", "$");
return safeValue;
StringgetAttribute(Element element, String name)
get Attribute
String value = element.getAttribute(name);
return replace(value);
StringgetAttribute(Element element, String name)
Get an Attribute from an Element.
return element.getAttribute(name);
StringgetAttribute(Element element, String name, String defaultVal)
get Attribute
if (element.hasAttribute(name)) {
    return element.getAttribute(name);
} else {
    return defaultVal;
StringgetAttribute(Element element, String namespace, String name)
Get the attribute value of an Element.
String value = null;
if (element.hasAttributeNS(namespace, name)) {
    value = element.getAttributeNS(namespace, name);
} else if (element.hasAttribute(name)) {
    value = element.getAttribute(name);
return value;
StringgetAttribute(Element element, String nodeName)
Returns the attribute of the provided nodeName.
return element.getAttribute(nodeName);