This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]