Subject: Re: [xsl] fo:page-number-citation and dynamic id's|
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 May 2006 06:48:03 +0200
is there any possibility in fo to use dynamic id's in xsl / xsl-fo?
background of my question: i need to generate 2 nearly identical (only one fo:block is different = address --> one document per address) output-docs. so i wrapped a xsl:for-each around the fo:page-sequence in my stylesheet. works great, also could reset the page-count in the second document ( initial-page-number="1"). so for an output in pdf with 4 pages per individual document and 2 adressen/element i get 8 pages, which consist of 2 documents, each correctly page-numbered from 1 to 4.
only one problem came up: i want to include page-numbers in the footer which look like 'page x of y' (also to be able to easily distinguish the 2 docs in my output-pdf). as long as only one document was the output, it worked. but if the whole fo:page-sequence is parsed more than one time, the solution with < fo:page-number-citation ref-id="last-page"/> didn't work any more because of multiple <fo:block id="last-page"/> (FOP-exception: "Property id "last-page" previously used; id values must be unique in document.").
so my question is: is there any possibility in xsl / xsl-fo to generate such id's (which, in contrary to the 'generate-id()'-function, can also be called)?
the concept i have in my mind is, that i generate one id 'last-page' for each //adressen/element , so each partial-output-document can be page-numbered like 'page x of y'.
here's the relevant part of my xml: [...] <xsl:for-each select="//adressen/element"> <fo:page-sequence master-reference="blattA4" initial-page-number="1" force-page-count="no-force"> <fo:static-content flow-name="xsl-region-before"> [...] <fo:blockalign="end"> <fo:page-number/> von <fo:page-number-citation ref-id="last-page"/>
</fo:block> [...] <fo:block id="last-page"/>
</fo:flow> </fo:page-sequence> </xsl:for-each> </fo:root> </xsl:template>
-- Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16 Also for XSL-FO/XSLT training: Minneapolis, MN 2006-07-31/08-04 Also for XML/XSLT/XSL-FO/UBL training: Varo,Denmark 06-09-25/10-06 World-wide corporate, govt. & user group UBL, XSL, & XML training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal