import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
public class Utils {
public static boolean hasAttribute(Element element, String value) {
NamedNodeMap attributes = element.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node node = attributes.item(i);
if (value.equals(node.getNodeValue())) {
return true;
}
}
return false;
}
}
sources68 the directory containing the programming examples, source code and programming guide online
Saturday, 6 August 2011
Has Attribute
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment