[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] variable going out of scope in a for-each loop?


Subject: Re: [xsl] variable going out of scope in a for-each loop?
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Mon, 10 Dec 2001 12:04:40 +0200

Christopher R. Maden wrote:

No, he didn't. This is a clever little bit of hackery. NaN is not equal to itself. So if the node value is a number, number(.)=number(.) is a tautology, but if the node value *isn't* a number, then NaN=NaN is false.
Well, number() = number() is an analog of more readable expression string(number()) = 'NaN',

so the issue is what is more effective and robust. First expression to be evaluated needs 2 string2numbe

conversions (may be optimized to only 1) and 1 number comparison, while the second one needs 1 string2number conversion, 1 number2string and 1 string comparison, so it seems to me that hack expression is a little more effective.
The only hope is XPath 2, which must support lexical representation of NaN.



-- Oleg Tkachenko Multiconn International, Israel


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




Current Thread
Keywords