Java XML Attribute Get getAttribute(Element elem, String name, String def)

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

Description

get Attribute

License

Open Source License

Declaration

public static String getAttribute(Element elem, String name, String def) 

Method Source Code

//package com.java2s;
//it under the terms of the GNU Affero General Public License as published by

import org.w3c.dom.Element;

public class Main {
    public static String getAttribute(Element elem, String name, String def) {
        return elem.hasAttribute(name) ? elem.getAttribute(name) : def;
    }//from w w w  .j av  a  2 s  .  c o  m
}

Related

  1. getAttribute(Element el, String attrName)
  2. getAttribute(Element el, String attrName)
  3. getAttribute(Element el, String attrName)
  4. getAttribute(Element elem, String attName, boolean mandatory)
  5. getAttribute(Element elem, String attName, boolean mandatory)
  6. getAttribute(Element element, String attr)
  7. getAttribute(Element element, String attribute)
  8. getAttribute(Element element, String attribute, String defaultValue)
  9. getAttribute(Element element, String attributeName)