Java XML Attribute Set attributeBoolValue(Element e, String attr)

Here you can find the source of attributeBoolValue(Element e, String attr)

Description

attribute Bool Value

License

Open Source License

Declaration

public static boolean attributeBoolValue(Element e, String attr) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Element;

public class Main {
    public static boolean attributeBoolValue(Element e, String attr) {
        if (!e.hasAttribute(attr))
            return false;
        String val = e.getAttribute(attr);
        return val.equals("yes") || val.equals("true") || val.equals("1");
    }//from ww w. j  av  a 2s .co m
}

Related

  1. attrbiuteToMap( NamedNodeMap attributes)
  2. attribute(Element element, String attrName)
  3. attribute(Node node, String... attributes)
  4. attributeBooleanGet(Element e, String name, boolean defaultValue)
  5. attributeBooleanSet(Element base, String name, boolean value, boolean defaultValue)
  6. attributeFloat(Node node, String attributeName)
  7. attributeIntValue(Element e, String attr)
  8. attributeMap(Element element)
  9. attributeOrNull(Node node, String... attributes)