[XQZone General] CIS handling of node equality?

Jason Hunter jhunter at marklogic.com
Sat Aug 14 21:53:00 PDT 2004


Within the definition of deep-equal at 
http://www.w3.org/TR/xpath-functions/#func-deep-equal you'll find:

"If the two nodes are both element nodes then they are deep-equal if and 
only if all of the following conditions are satisfied: ... One or both 
of the element nodes has a type annotation that is neither a simple type 
nor a complex type with simple content, and the sequence $i1/(*|text()) 
is deep-equal to the sequence $i2/(*|text())."

So assuming untyped data, the Mark Logic answer is correct.  Applying a 
schema can of course change behavior because then the data values are 
compared and whitespace can be irrelevant in determining data values.

-jh-

David Sewell wrote:

> CIS 2.1-3 returns "false" for both these comparisons:
> 
>   <foo><bar>baz</bar></foo> eq <foo> <bar>baz</bar></foo>
> 
>   deep-equal(<foo><bar>baz</bar></foo>, <foo> <bar>baz</bar></foo>)
> 
> where the only difference is the whitespace after the <foo> tag. They
> both evaluate to "true" if the whitespace is deleted.
> 
> Is this buggy behavior or not? Saxon 8.0 returns "true" for both.
> Seems to me the XML parser should treat that whitespace as
> irrelevant for node comparison.
> 
> David
> 



More information about the General mailing list