but How?
Hi,
Can't you use multiple page-sequences instead of just creating one sequence
'interrupted' by the 'ctrlPage' template?
this template is more difficult since it is used in with a more complicated XML like <group><product/>...</group>..., the way that I sent is for brevety to discover because ctrlPage don't work, for groups I need print a header, followed by products, etc..., in original XSL i use xalan extensions to count how many lines I used PDF.
A few remarks to help you on your way:because, I reduced the code for brevety, then the static-content is for groups case. sorry
1. I can't seem to find the reason why you are placing the whole
<fo:static-content > into a separate template, since it is ... well, static
and it doesn't rely on the elements in the XML (unless something is
missing).
but for-each select don't put Xalan in DOM process? consumes more memory? however I can't use position because the original XML is more complex. (I use xalan extensions to control this). like this <xsl:if test="counter:read('ctLine') mod 3"></xsl:if>2. In the ctrlPage template, you are testing for a position(): you could also use XPath to select these, like
<xsl:apply-templates select="product[(position() mod 3) = 0]
Then inside the product template, use
<xsl:for-each select="preceding::product[position() < 3] />
to grab the two preceding product nodes.
Thanks for tips3. Check our http://xml.apache.org/fop/resources.html page, among the books and articles, there's a link to Dave Pawson's XSLT FAQ. Over there, you'll find a lot of useful stuff (amongst others on grouping which I think you'll find particularly helpful), so I'll bet you can work out a redesign which affects only the XSL itself and leaves the other files alone.
If you really can't get any further, try posting your problem on Mulberry's XSLT list. Warning: it's a quite high-traffic list, but the upside is that the tips are 'highly-usable' ;)
Hope this helps!
Cheers,
Andreas
Clovis