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

> I'd like to compare two nodes for equality. 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.

You'll have to explain exactly what you mean by node equality. There are a
great many possible definitions. We have provided "eq" and "fn:deep-equal()"
to support two possible definitions; it's not clear that there are other
definitions of node equality that are sufficiently widely accepted that they
should be in the core library. You can always write your own comparison
function.

> 
> BTW, op:node-equal() still tests for identity instead of equality.
> 

Yes, this internal function is designed to support the "is" operator. It's
not a well-chosen name, but the name will never be seen by users.

Michael Kay

Received on Tuesday, 13 May 2003 20:27:19 UTC