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

xsl:accumulator and temporary trees

Subject: xsl:accumulator and temporary trees
From: "Christophe Marchand cmarchand@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 Feb 2020 14:01:20 -0000
 xsl:accumulator and temporary trees
Hello,

I use an accumulator to calculate height of block elements in a page.

My accumulator is defined like this :

B <xsl:accumulator name="height.counter" as="xs:double" initial-value="0.0">
B B B <xsl:accumulator-rule match="page" select="2.3"/>
B B B <xsl:accumulator-rule match="li1" select="$value + 1.9" phase="end"/>
B B B <xsl:accumulator-rule match="li2" select="$value + 1.8" phase="end"/>
B B B <xsl:accumulator-rule match="li3" select="$value + 1.34" phase="end"/>
B B B <xsl:accumulator-rule match="private:block" select="$value + xs:double(./@height)" phase="end"/>
B </xsl:accumulator>


Modes are defined like this :

B <xsl:mode name="private:acc" on-no-match="shallow-skip" use-accumulators="#all"/>
B <xsl:mode use-accumulators="#all"/>


For a special element, I calculate the block height, and I proceed like this :

B B B  <xsl:variable name="block" as="element(private:block)">
B B B B B  <private:block height="{$height}"/>
B B B  </xsl:variable>
B B B  <xsl:apply-templates mode="private:acc" select="$block"/>

li1, li2 and li3, which are in source tree and processed in default mode do modify accumulator value. But my accumulator is never incremented when a private:block is processed.

Any suggestion will be much appreciated.

Best, and see you at Prague,
Christophe

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.