xsl-list
[Top] [All Lists]

Re: maker and retrieve-marker question

2003-03-01 09:49:43
HS wrote:
I am having a problem in using the marker and
retrieve-marker to calculate page subtotals.
...
> then, in the same static block, i want to show the
> result of the
> subtraction of those two variables from each other,...

You are mixing transformation and formatting. These are two
different steps.

<xsl:variable name="previous_cumulative_total">
    <fo:retrieve-marker
retrieve-class-name="previous_cumulative_total_marker"
retrieve-boundary="page"
retrieve-position="first-starting-within-page"/>
</xsl:variable>

Here you have a variable holding an RTF with basically
an element node for a fo:retrieve-marker element. This
can be copied through to the output into the FO document,
as you discovered:

Now, if i do <xsl:copy-of select"$previous_cumulative_total"/> , it
shows me the  number.

The mechanism is that you got the fo:tretrieve-marker into
the FO document, and the FO formatter replaced it during
formatting with the retrieved marker, i.e. the subtotal
you want to have.

However, page breaking and marker retrieval is done by
the FO formatter, *after* the whole XSL transformation run.
There is no way to get the retrieved markers during the
transformation stage.

and how can i get the result of the subtraction of the
two variables?

No way. A FO formatter can't do such calculations.

is there another way of doing this?
Tricky. You can try to emulate page breaking at the XSLT stage,
if your record rows are all of the same height, you precalculate
the number of rows per page by hand and put this number in a
table, followed by a forced page break.

J.Pietschmann


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>
  • Re: maker and retrieve-marker question, J.Pietschmann <=