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

Re: [xsl] A smarter choose operation XSL 1.1


Subject: Re: [xsl] A smarter choose operation XSL 1.1
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 11 Jun 2009 09:18:51 +0100

> Would someone expand on this oddity please?

are yous aying MK is Odd?


> I'm guessing 'true' in this case is the xslt version of 'true'...
> I.e. non-empty?

no, simpler than that, the values in questions are boolean so 'true'
means true() as opposed to false()

($opt.one, $opt.two, $opt.three)[.]

is a sequence of three things, filtered by  [ ] exppression
just like
(1,2,3)[.=2]

The result is the sequence of all items for which the predicate is true.
In teh second example that woudl result in
(2)

In the first example the predicate is just the item .. so it is true if
. is true and false if it is false, so if $opt.one and  $opt.three
are true() and  $opt.two is false() then 

($opt.one, $opt.two, $opt.three)[.]

is 

($opt.one,$opt.three)

and count($opt.one,$opt.three) is 2, telling you that 2 items are true.




David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________


Current Thread
Keywords