[XQZone General] CIS handling of node equality?

David Sewell dsewell at virginia.edu
Sun Aug 15 11:48:29 PDT 2004


Jason, thanks for the explanation. This was a case of my forgetting that 
just because an XML element looks like it's not a mixed-content element, 
nothing says it isn't unless it's formally defined that way. So the lack 
of equality makes perfect sense.

David

On Sat, 14 Aug 2004, Jason Hunter wrote:

> 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
>> 
> _______________________________________________
> General mailing list
> General at xqzone.marklogic.com
> http://xqzone.com/mailman/listinfo/general
>

-- 
David Sewell, Editorial and Technical Manager
Electronic Imprint, The University of Virginia Press
PO Box 400318, Charlottesville, VA 22904-4318 USA
Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
Email: dsewell at virginia.edu   Tel: +1 434 924 9973



More information about the General mailing list