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

[F&O] 15.2.1 fn:deep-equal

From: David Carlisle <davidc@nag.co.uk>
Date: Mon, 17 Nov 2003 16:31:09 GMT
Message-Id: <200311171631.QAA31538@penguin.nag.co.uk>
To: public-qt-comments@w3.org

I have commented on previous drafts that this function is unlikely to be
much use in practice as it has far too many arbitrary choices of what
constitutes equality and it ought to be moved to appendix C.

However assuming that it stays here the current definition appears to
have problems with document nodes.

Currently this clause is commented out

  (: if ($parameter1 instance of document-node() and not ($parameter2
  instance of document-node())) then fn:false() else :)

which means that if the first param is a document node and the second a
comment, they will return true if their string values are equal,
however if the same two parameters are given in the other order it will
return false due to
  if ($parameter1 instance of comment() and not ($parameter2 instance of
  comment())) then fn:false() else

so deep-equal isn't symmetric.

Even if that clause is restored, it appears that if both arguments are
document nodes then the test will fall through to:

  else  (: Must be a namespace node by elimination :)
   fn:compare (fn:string($parameter1), fn:string($parameter2)) ne 0

and so the string values of the documents will be compared, which
probably isn't what was intended.


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:
Received on Monday, 17 November 2003 11:35:34 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:15 UTC