Bob,
Thank you very much for this answer.
I looked at the PSMI technique which is very interesting; however it
has the limitation that the psmi:page-sequence element must be a direct
children of fo:flow.
In our case we have to deal with more deeply nested sections.
So PSMI inspired me to try a more generic approach as follows:
. the first pass can output fo:page-sequence for any section
(according to specific rules); this is obtained by customizing
the template match="/section" in sections.xsl (the match
attribute is modified to trigger the template for sections
that need their own page-sequence)
. the resulting fo is of course *not* valid
. a second pass brings any fo:page-sequence to the upper level
(direct child of root) by "cutting and reconstructing" the
elements where any fo:page-sequence is found
The second pass does the following: given this source and the
instruction to cut at 'z' elements:
<a>
<b>
<c/>
</b>
<d/>
<e/>
<z num="5"/>
<z num="6">
<n/>
<z num="6.5"/>
<o/>
</z>
<z num="7"/>
<f id="conflit">
<g>
<z num="1"/>
<k>
<h/>
<i/>
<z num="2">
<x/>
<z num="3"/>
<y/>
</z>
<j/>
</k>
</g>
</f>
</a>
it outputs this:
<a>
<b>
<c/>
</b>
<d/>
<e/>
<z num="5"/>
<z num="6">
<n/>
</z>
<z num="6.5"/>
<z num="6">
<o/>
</z>
<z num="7"/>
<f>
<g/>
</f>
<z num="1"/>
<f>
<g>
<k>
<h/>
<i/>
</k>
</g>
</f>
<z num="2">
<x/>
</z>
<z num="3"/>
<z num="2">
<y/>
</z>
<f>
<g>
<k>
<j/>
</k>
</g>
</f>
</a>
ie, any element containing a 'z' element is split at the 'z'
element, the 'z' element is output, then the rest of the parent
element is output inside a 'reconstruction' of the element.
This seems to work fine, on a fairly long document (900 pages),
and requires only a very limited customization of the stylesheets
(without the need to insert special markers: the markers are
the fo:page-sequence themselves); however there are some problems
. the most important problem is that since the second pass
duplicates elements to "reconstruct" the rest of the
page-sequence, there are some id conflict; brutally removing
duplicate ids of course break some internal references,
but finding which id should be saved and which ones should
be deleted or replaced proves quite difficult
. some fo:retrieve-marker seem to be lost in the process
. we don't use any special page-numbering which would probably
not survive to this...
It would help if I knew more about FO in general: which good
detailed book about FO would you recommend? (I have your
book on docbook stylesheets, and it's great! ;-)
Regards,
EB
> -----Original Message-----
> From: Bob Stayton [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 27, 2008 6:08 PM
> To: Emmanuel Bégué; [email protected]
> Subject: Re: [docbook-apps] Starting a page sequence at the section
> level
>
> Another appoach uses the PSMI technique [1] that G. Ken Holman
> created. It is typically used to insert a landscape page sequence
> in the middle of a page sequence to handle a landscape table, but
> it could be adapted to your two-column page sequences instead.
>
> [1] http://www.cranesoftwrights.com/resources/psmi/index.htm
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]