xsl-list
[Top] [All Lists]

Re: [xsl] Boolean Value of a Sequence of Booleans

2014-12-05 15:38:54
At 2014-12-05 20:39 +0000, Eliot Kimber ekimber(_at_)contrext(_dot_)com wrote:
Using XSLT2, I'm examining all the items in a key() map to see if any
entries in the map have more than 1 item. I'm doing this by iterating over
the keys. I'm then producing a boolean for each iteration and capturing
the sequence of booleans in a variable.

Not knowing the details of your key invocation, could you not do something like:

   some $key in $allKeys satisfies count(key($key,$lookup)) > 1

But my question still remains: is there a built-in way to apply boolean
operators to a sequence of booleans or would I need to write my own
function?

If your operator is OR then:

   some $b in $booleanSeq satisfies $b

If your operator is AND then:

   every $b in $booleanSeq satisfies $b

By using 'some' and 'every' you are passing on the logic and optimization to the processor.

I hope this helps ... unless I'm missing something in your requirement.

. . . . . . Ken


--
Check our site for free XML, XSLT, XSL-FO and UBL developer resources |
Free 5-hour lecture:  http://www.CraneSoftwrights.com/links/video.htm |
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                    
mailto:gkholman(_at_)CraneSoftwrights(_dot_)com |
Google+ profile:       http://plus.google.com/+GKenHolman-Crane/about |
Legal business disclaimers:     http://www.CraneSoftwrights.com/legal |


---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>