Re: [xsl] () eq () vs () = ()

Subject: Re: [xsl] () eq () vs () = ()
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 30 Sep 2011 13:30:41 +0100
On 30/09/2011 10:43, Andrew Welch wrote:
I've recently found out (over on the saxon list) that:

() eq ()

returns the empty sequence, but

() = ()

returns false.



To add a little footnote, a couple of weeks ago I had a user who had written


test="contains(a,b) = false"

and in 1.0 this produced the same result as if he had written

test="contains(a,b) = false()"

because in 1.0, when you compare a node-set to a boolean you convert the node-set to a boolean and compare the two booleans, and the node-set false will usually convert to the boolean false(). But in 2.0 his code stopped working because the rules for comparing a node-set to a boolean changed, the WG imagining very few users would do this intentionally...

Michael Kay
Saxonica

Current Thread