[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: 99 bottles of beer
On 2/5/07, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
Andrew Welch wrote: > > The difference there is that (1 to 2) != 10 returns a sequence of 2 > items "true true", whereas (1,2) != 10 returns a single "true". I > would have to look it up but I think anything other than a single > "true" converts to false, so "true true" returns false. > > You could rewrite it as ((1 to 2) != 10) = false() to check the values > in the sequence for any occurance of false(), and return a single > true/false.
Thanks Andrew, for the mind exercise, it was fun getting the grips (almost) to some less-than-obvious stuff.
Note that the trick you mentioned, does not work, because the first part (before '= false()') does not return a sequence of all false/true values, it returns, as I see it, a sequence of one item. Yes, I was basing all this on: for $i in (1 to 3) return $i != 4 which I thought was equivalent to: (1 to 3) != 4 and based on my incorrect assumptions of the above producing a sequence of booleans I thought it could be rewritten to: ((1 to 3) != 4) = true() whereas it must be: (for $i in (1 to 3) return $i != 4) = true() Again, sorry about that. cheers andrew
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|