Re: node equality: fn:node-equal()

Kay, Michael wrote:


> Since you don't seem able to give a precise definition,


The most common idea of "fn:shallow-equal", parallel to fn:deep-equal.

> perhaps I can give
> you a multiple choice question. Here are some elements. Which pairs of
> elements do you regard as being "equal"?
> 
> 1: <a/>
> 2: <a> </a>
> 3: <a xsi:nil="true"/>
> 4: <a att="2"> </a>
> 5: <a><!-comment--> </a>
> 6: <a><b/> </a>
> 7: <b> </b>


Various sensible answers are possible; I don't know which one is the 
most common one (on this list, in the community, in the WG(s)).


> I'm sure that if you asked ten people this question, they would come up with
> ten different answers.


The most common answer could be chosen and specified.

> Certainly, from the information you have given, I
> have no way of knowing which of these elements you regard as being equal to
> each other.


Any answer is arguable, and many would be sensible.

As with any other aspect of the spec(s), one definition is chosen after 
discussion. I would think that there aren't many aspects of the spec(s) 
that everyone agrees on.


> We have provided access to most of the interesting properties of an element
> using basic functions: the string value, the name, the typed value, the base
> URI, the set of in-scope namespaces, the attributes. You can combine these
> properties in any way you like to create a definition of node equality that
> suits your own view of what it means for two nodes to be equal.


Yes, as I wrote: I could do it by testing various aspects of the pair, 
thus writing my:node-equal(), but I'd prefer to have it available in the 
language.

I still see reasons for including it, but I also see the reasons against 
that which you and Michael Rys list.

Thank you very much for taking the time to discuss such topics! As I 
said many times before, I'm already enjoying coding in XSLT 2. An open 
process makes sure that it will continue to get even better :)

P.S.

In
http://lists.w3.org/Archives/Public/public-qt-comments/2003May/0193.html
You wrote 'We have provided "eq"'; what's the URL to its definition? TIA.


Tobi

-- 
http://www.pinkjuice.com/

Received on Thursday, 15 May 2003 03:50:36 UTC