[FO req] Auxilary file feature

Hi,

It is sometimes necessary to feed back the page cutting results into the document system
that eventually produced the fo tree, i.e. to know onto which page some element went.

In legislation texts, for example, the page number can be a formal reference item. If such
texts are published in several languages, the contents of a page is the same in every language.
To provide such an alignment it is necessary to know where the pages ended in the reference
language in order to introduce hard page breaks in the source document and thus make the
information available for all languages.
Another issue is that in the publication cycle process, changes can be expressed as changes to
pages. This also requires the knowledge of the page breaks.

Therefore, I propose a very simple extension, which is the auxilary file. This is of course
borrowed from TeX. It could be implemented by adding a "auxilary-resource" element for
usage in the declarations element. It would specify an URI, a name and the name of a document
root element. Several such elements would be allowed in the declarations element. For each
instance an XML document would be created with the corresponding document root element.

Throughout the rest of the fo tree the "auxilary" element would be allowed. It would not
generate any areas itself, but merely pass through the areas generated by any fo elements in it.
The convention would be that all elements in it, which are outside of the fo namespace, are
output literally to the auxilary resource referred to with the name property. The value of
fo:page-number could be used for text generation in an XSLT like way. It would be set to the page
containing the first area produced by its containing fo tree.

Here is an example:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
   <fo:layout-master-set>
     <fo:simple-page-master
         master-name="page" page-height="297mm" page-width="210mm"
         margin-top="20mm" margin-bottom="10mm" margin-left="25mm"
         margin-right="25mm">
        <fo:region-body
            margin-top="0mm" margin-bottom="15mm" margin-left="0mm"
            margin-right="0mm"/>
        <fo:region-after extent="10mm"/>
      </fo:simple-page-master>
   </fo:layout-master-set>

   <fo:declarations>
     <fo:auxilary-resource
        external-destination="titles.xml" auxilary-name="titles"
        doctype="title-locations"/>
     <fo:auxilary-resource
        external-destination="misc.xml" auxilary-name="misc"
        doctype="misc"/>
   </fo:declarations>

   <fo:page-sequence master-reference="page">
     <fo:static-content flow-name="xsl-region-after">
       <fo:block>Page <fo:page-number/> </fo:block>
     </fo:static-content>

     <fo:flow flow-name="xsl-region-body">
       <fo:auxilary auxilary-name="titles">
          <!-- The syntax of the page property is as in XSLT, it would be
            -- interpreted by the formatter.
            -- The path property is generated by the XSLT sheet which created
            -- the whole fo tree (cfr. role property).
            -->
          <title path="/doc/part[1]/chapter[1]" page="{string(fo:page-number)}">
            <fo:block id="N5">1. Chapter</fo:block>
           <info>This is a title</info>
         </title>
       </fo:auxilary>

       <fo:auxilary auxilary-name="misc">
         <!-- The fo:value-of would be the equivalent of xsl:value-of. -->
         <para>
           <text>Text</text>
           <page><fo:value-of select="fo:page-number"/></page>
         </para>
         <fo:block>Text</fo:block>
       </fo:auxilary>

       <fo:block id="N13">2. Chapter</fo:block> <fo:block>For a description of X see page
<fo:page-number-citation refid="N5"/></fo:block> </fo:flow>
   </fo:page-sequence>
</fo:root>

Of course, such functionality could be provided by a particular XSL-FO processor, but then
one would depend on it.

Regards,

Werner.
-- 
Werner Donné  --  Re BVBA
Engelbeekstraat 8		Papenhof 15
B-3300 Tienen			B-3583 Beringen
tel: (+32) 486 425803	e-mail: werner.donne@re.be

Received on Tuesday, 16 October 2001 09:15:52 UTC