共用方式為


INode.IsEqualNode(INode) Method

Definition

Tests whether two nodes are equal.

[Android.Runtime.Register("isEqualNode", "(Lorg/w3c/dom/Node;)Z", "GetIsEqualNode_Lorg_w3c_dom_Node_Handler:Org.W3c.Dom.INodeInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool IsEqualNode (Org.W3c.Dom.INode? arg);
[<Android.Runtime.Register("isEqualNode", "(Lorg/w3c/dom/Node;)Z", "GetIsEqualNode_Lorg_w3c_dom_Node_Handler:Org.W3c.Dom.INodeInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member IsEqualNode : Org.W3c.Dom.INode -> bool

Parameters

arg
INode

The node to compare equality with.

Returns

Returns true if the nodes are equal, false otherwise.

Attributes

Remarks

Tests whether two nodes are equal. <br>This method tests for equality of nodes, not sameness (i.e., whether the two nodes are references to the same object) which can be tested with Node.isSameNode(). All nodes that are the same will also be equal, though the reverse may not be true. <br>Two nodes are equal if and only if the following conditions are satisfied: <ul> <li>The two nodes are of the same type. </li> <li>The following string attributes are equal: nodeName, localName, namespaceURI, prefix, nodeValue . This is: they are both null, or they have the same length and are character for character identical. </li> <li>The attributesNamedNodeMaps are equal. This is: they are both null, or they have the same length and for each node that exists in one map there is a node that exists in the other map and is equal, although not necessarily at the same index. </li> <li>The childNodesNodeLists are equal. This is: they are both null, or they have the same length and contain equal nodes at the same index. Note that normalization can affect equality; to avoid this, nodes should be normalized before being compared. </li> </ul> <br>For two DocumentType nodes to be equal, the following conditions must also be satisfied: <ul> <li>The following string attributes are equal: publicId, systemId, internalSubset. </li> <li>The entitiesNamedNodeMaps are equal. </li> <li>The notationsNamedNodeMaps are equal. </li> </ul> <br>On the other hand, the following do not affect equality: the ownerDocument, baseURI, and parentNode attributes, the specified attribute for Attr nodes, the schemaTypeInfo attribute for Attr and Element nodes, the Text.isElementContentWhitespace attribute for Text nodes, as well as any user data or event listeners registered on the nodes. <p ><b>Note:</b> As a general rule, anything not mentioned in the description above is not significant in consideration of equality checking. Note that future versions of this specification may take into account more attributes and implementations conform to this specification are expected to be updated accordingly.

Added in DOM Level 3.

Java documentation for org.w3c.dom.Node.isEqualNode(org.w3c.dom.Node).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to