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

accumulation counter in xsl

Subject: accumulation counter in xsl
From: "Shane Knysh" <shane.knysh@xxxxxxxxx>
Date: Sun, 3 Oct 2004 19:48:32 -0700
counter in xsl
Greetings All!

I have found a few related topics in the archives but I can not find the answer to my
question. First some background: we have a xsl:fo reporting solution coming (its about 6-9
months away), but in the meantime we are trying to make our plain html reports a little
more appealing by using xml and xsl to make the reports print with headers, footers,
summaries, etc. 

The xml report data files all follow the same structure:
<report>
<name>report name</name>
<structure>
definition of the data fields with type, max length, etc. This description is only
published for clients that want to create alternative xsl files for report generation.
</structure>
<data>
<item>
one report row in the format
<value1 length="111">display value</value1>
<value2 length="222">display value</value2>
</item>
</data>

What I am having difficulty with is dynamic paging. I can make the report display properly
by enforcing a rule like each item takes 3 lines, so a 48 line page requires a page break
every 16 items using something like test="position() mod 16 = 0". What I want is to be
able to do dynamic paging.

I am trying to do this using an accumulating counter. 

I want to calculate the number of lines a given item will require (I have this working),
and keep a running total of the number of lines used. Then when their is not enough lines
to display the current item on the current page, display the page footer, initiate a new
page using css2, display a page header, and then display the item.

I have read some online and text examples that recommend using a for-loop template but I
can not reconcile the for-loop and for-each I am using to display each item.

Any assistance would be greatly appreciated. 

-- 
Shane
shane.knysh at YonerDotCom
"God doesn't play dice with the universe." 
     - Albert Einstein
"God not only plays dice, he does it where no one can see" 
     - Stephen Hawking 

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.