W3C home > Mailing lists > Public > public-qt-comments@w3.org > December 2003

[F&O] deep-equal

From: David Carlisle <davidc@nag.co.uk>
Date: Wed, 3 Dec 2003 12:37:58 GMT
Message-Id: <200312031237.MAA00639@penguin.nag.co.uk>
To: public-qt-comments@w3.org


I commented on the previous draft (a day or so before the release of the
current draft) that deep-equal would be better in the user-defined appendix:

http://lists.w3.org/Archives/Public/public-qt-comments/2003Nov/0210.html

The version in this draft appears to be unchanged, so the comments made
there still apply. (deep-equal appears to be completely broken wrt to
document nodes).

In addition I have noticed some further problems with the given
definition.

1) The is-namespace-node() function should be in some non null
   (example.org) namespace so that this definition is legal in xslt as a
   user-defined function.


2) the note 

     The contents of comments and processing instructions are
     significant only if these nodes are used directly as arguments to
     the function, not if they appear as children of the nodes supplied
     as arguments.

is strictly true (the content is insignificant) but it is rather  misleading.
The _content_ of comments are (bizarrely) not compared by the given
definition unless they are items in the sequence being compared, but
comments are not ignored: their _presence_ affects the equality.

given

1 <x>ab</x>
2 <x><!-- z -->ab</x>
3 <x>a<!-- z -->b</x>
4 <x>ab<!-- z --></x>
5 <x>a<!-- zz -->b</x>

1 == 2 == 4
3 == 5

as in 1,2,4 x has a single text node child with value ab but in 3 and 5
there are two text node children.

This is a particularly arbitrary choice of equality definition.

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
Received on Wednesday, 3 December 2003 07:38:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:28 GMT