[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Are xsl:accumulator-rules exclusive ?

Subject: Re: Are xsl:accumulator-rules exclusive ?
From: "Christophe Marchand cmarchand@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Sep 2020 22:30:49 -0000
Re:  Are xsl:accumulator-rules exclusive ?
Thanks a lot, Michael.

Best regards,
Christophe

Le 22/09/2020 C  00:01, Michael Kay mike@xxxxxxxxxxxx a C)critB :
> B'18.2.3: B If there is more than one matching rule, the last in 
> document order is used. If there is no matching rule, the value of the 
> accumulator variable does not change.
>
> Michael Kay
> Saxonica
>
>> On 21 Sep 2020, at 22:52, Christophe Marchand cmarchand@xxxxxxxxxx 
>> <mailto:cmarchand@xxxxxxxxxx> 
>> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx 
>> <mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>> wrote:
>>
>> Hello,
>>
>> I didn't manage to find the response in the specs, so...
>>
>> Are xsl:accumulator-rule mutually exclusives, and do default 
>> priorities for template rules apply in accumulator-rule ? Is the same 
>> node able to fire many xsl:accumulator-rule in the same mode, if 
>> evaluated only once ?
>>
>> For example, if I have this accumulator :
>>
>> B  <xsl:accumulator name="weight" as="xs:integer" initial-value="0">
>> B B B  <xsl:accumulator-rule match="box[xs:integer(@width) gt 
>> 100][xs:integer(@height) gt 100]" select="$value + 100"/>
>> B B B  <xsl:accumulator-rule match="box[xs:integer(@width) gt 
>> 50][xs:integer(@height) gt 50]" select="$value + 50"/>
>> B B B  <xsl:accumulator-rule match="box" select="$value + 1"/>
>> B  </xsl:accumulator>
>> B  <xsl:mode use-accumulators="#all" on-no-match="shallow-copy"/>
>>
>> B  <xsl:template name="xsl:initial-template">
>> B B B  <xsl:variable name="content" as="element(box)*">
>> B B B B B  <box width="150" height="150"/>
>> B B B  </xsl:variable>
>> B B B  <xsl:apply-templates select="$content"/>
>> B  </xsl:template>
>>
>>
>> I'd expect to get <box width="150" height="150">100</box> but I get 
>> <box width="150" height="150">1</box>.
>>
>> Is it normal ?
>>
>> Should I put a xsl:choose in the rule match="box" and evaluate all 
>> possibilities inside the choose ?
>>
>> Best regards,
>> Christophe
>>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/2837134> 
> (by email <>)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.