Java XML Attribute Get getAttribBoolean(Element ele, String name)

Here you can find the source of getAttribBoolean(Element ele, String name)

Description

Parses the given attribute of this tag and returns it as a boolean.

License

Open Source License

Declaration

public static boolean getAttribBoolean(Element ele, String name) 

Method Source Code


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

public class Main {
    /**/*from w w  w .j  a  v  a2 s .  c o  m*/
     * Parses the given attribute of this tag and returns it as a boolean.
     * Essentially compares the lower case textual value to the string "true"
     */
    public static boolean getAttribBoolean(Element ele, String name) {
        String sval = ele.getAttribute(name);

        return sval.toLowerCase().equals("true");
    }
}

Related

  1. getAttrBool(Node n, String name)
  2. getAttrDate(Element elem, String localName)
  3. getAttrib(NamedNodeMap attribs, String name)
  4. getAttribAsBoolean(Element e, String name, Boolean dft)
  5. getAttribAsFloat(Element e, String name, Float dft)
  6. getAttribByName(Element node, String name)
  7. getAttribFloat(Element ele, String name)
  8. getAttribIntHex(Element ele, String name)
  9. getAttribString(Element ele, String name)