How can I Manage this?

Hello,
 
I have a problem and I hope you can help me.
I want to generate a series of documents. All documents are split  in two parts. I will call one part header and one part data.
The header part is of specific size. The data part can extend over one or two pages. So a single document is one or two pages long.
The header should exist on each page. No matter is the document one or two pages long. Do the document have only one page, the header content is only on one page. Do the document have two pages, the header content is on both pages the same.
 
Example:
I have a document size of two pages for both employees Donald and Micky. Then the layout is looking like this
 
Donald
Data
------------------- New Page
Donald
Data
------------------ New Page
Micky
Data
------------------ New Page
Micky
Data
 
 
Here is the datastructure of the XML file, which I want to transform:
<Root>
      <groupheader>
            <employeeheader>
                       ….
            </employeeheader>
            <employeedata>
                      ….
            </employeedata>
      </groupheader>
      <groupheader>
            <employeeheader>
                       ….
            </employeeheader>
            <employeedata>
                      ….
            </employeedata>
      </groupheader>
            ….
</Root>
 
The data of the header part is written in the employeeheader. The data of the data part is written in the employeedata.
 
I’d tried the last two days to get the wished result. Without any effect.
On Fop 0.20 I get only one header on a page, but it altereated in a manner, that the header part didn't match the data part. So I upgraded to version 0.95. Here I get the header of both employees on every page.
So I tried to modify the XSLT transformation. But I got always errors like <xsl:template> not allowed in <fo:root> (or other locations;-))
 
Here Is a code snippet, which I use in the moment, but the result is not the intended result.
            <xsl:template match="/Root">
            <fo:root>               
                  <fo:layout-master-set>
                        <fo:simple-page-master 
                             page-height="21.0cm"
                             page-width="29.7cm"
                             margin-top="0.8cm"
                             margin-bottom="0.5cm"
                              margin-left="1.0cm"
                             margin-right="2.0cm"
                             master-name="first">
                             <fo:region-body margin-top="2.5cm" margin-bottom="2cm"/>
                             <fo:region-before extent="3cm" region-name="region-before"/>                             
                        </fo:simple-page-master>
                  </fo:layout-master-set>
                  <fo:page-squence-master>
 
                  </fo:page-squence-master>
                  <fo:page-sequence master-reference="first">
                        <fo:static-content flow-name="region-before">
                                   <xsl:apply-templates select="groupheader/employeeHeader"/>
                        </fo:static-content>
                        <fo:flow flow-name="xsl-region-body">
                                         <xsl:apply-templates select="groupheader/employeeDataRoot"/>
                        </fo:flow>
                  </fo:page-sequence>
            </fo:root>
            </xsl:template>
      <xsl:template match="employeeHeader">          
            <fo:block space-after="1mm" text-align="left" >
            ….
            </fo:block>
      </xsl:template>
      <xsl:template match=”employeeDataRoot”>
            <fo:block>
              ….
            </fo:block>
      </xsl:template>
 
I really hope, you can help me.
 
Ciao Thomas


      

Received on Wednesday, 20 May 2009 08:33:07 UTC