Name

isEqualNode: arg(3)

Synopsis

This method compares the node on which the method is invoked with the node referenced by the other parameter. The two nodes are considered to be equal if:

  • They are of the same type

  • The following attributes are equal: nodeName, localName, namespaceURI, prefix, nodeValue

  • The attributes maps are equal (contain the same number of nodes that are equal to one another)

  • The childNodes lists are equal (the child node trees are identical, and each child passes this equality test with its counterpart in the other tree)

  • For DocumentType nodes only: the publicId, systemId, internalSubset, entities, and notations attributes must be identical as well

The method returns true if the nodes pass all of the above tests; otherwise, it returns false.

Argument

arg: Node

The node to use in the comparison.

Java binding

public boolean isEqualNode(Node arg);

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.