Java Utililty Methods XML Node to Element

List of utility methods to do XML Node to Element

Description

The list of methods to do XML Node to Element are organized into topic(s).

Method

booleanisElement(final Node n)
is Element
return n instanceof Element;
booleanisElement(Node e)
is Element
return e.getNodeType() == Node.ELEMENT_NODE;
booleanisElement(Node node)
is Element
return node.getNodeType() == Node.ELEMENT_NODE;
booleanisElement(Node node)
Returns whether the specified node is an element
return node.getNodeType() == Node.ELEMENT_NODE;
booleanisElement(Node node)
Determines if the given Node is non-null and is an XML Element.
return node != null && node.getNodeType() == Node.ELEMENT_NODE;
booleanisElement(Node node)
Determines if the given Node is non-null and is an XML Element.
return (node != null && node.getNodeType() == Node.ELEMENT_NODE);
booleanisElement(Node node)
is Element
short nodeType = node.getNodeType();
if (Node.ELEMENT_NODE == nodeType || Node.DOCUMENT_NODE == nodeType) {
    return true;
return false;
booleanisElement(Node node, String name)
is Element
return node.getNodeType() == Node.ELEMENT_NODE && node.getNodeName().equals(name);
booleanisElementByTag(Node node, String tagName)
is Element By Tag
if (!(node instanceof Element))
    return false;
if (tagName == null)
    return true;
Element element = (Element) node;
String tag = element.getTagName();
return tag.equals(tagName) || getLocalName(tag).equals(getLocalName(tagName));
booleanisElementContent(Node node)
Checks whether the specified node has element content or consists only of character data.
if (node == null) {
    return false;
NodeList children = node.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
    Node child = children.item(i);
    if (child.getNodeType() == Node.ELEMENT_NODE) {
        return true;
...