The node positions cannot be determined relative to each other in the document order, or a null reference (Nothing in Visual Basic) is specified as the XPathNavigator parameter. This could occur if the two nodes reside in different trees.
The ComparePosition method's behavior is dependent on the XPathNodeType the XPathNavigator is currently positioned on. When comparing nodes in the XML document, the following rules apply:
Element nodes: These nodes are returned in document order from the source document.
Namespace nodes: These nodes may be returned in document order and are always before the Attribute nodes of the parent element.
Attribute nodes: These nodes may be returned in document order. They always come after the Namespace nodes and before any child nodes of the parent node.
For more information about the XPath data model and details about each of the node types, see section 5 of the W3C XML Path Language (XPath) recommendation located at http://www.w3.org/TR/xpath#data-model.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)