Java examples for XML:XML Attribute
get Attribute Boolean from XML Node by name
//package com.java2s; import org.w3c.dom.Node; public class Main { public static boolean getAttributeBoolean(Node node, String name) { return Boolean.parseBoolean(getAttribute(node, name)); }//w ww.java 2 s. c o m public static String getAttribute(Node node, String name) { if (node == null) { return null; } Node val = node.getAttributes().getNamedItem(name); if (val == null) { return null; } return val.getNodeValue(); } }