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

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

Subject: Re: [xsl] Boolean Value of a Sequence of Booleans
From: "G. Ken Holman g.ken.holman@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 5 Dec 2014 21:38:49 -0000

At 2014-12-05 20:39 +0000, Eliot Kimber ekimber@xxxxxxxxxxxx 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

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@xxxxxxxxxxxxxxxxxxxx | 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

Current Thread