W3C home > Mailing lists > Public > www-xsl-fo@w3.org > January 2004

Title Page + rest of a document

From: Franz Schmid <fschmid07@yahoo.de>
Date: Thu, 8 Jan 2004 20:04:38 +0100 (CET)
Message-ID: <20040108190438.92030.qmail@web25209.mail.ukl.yahoo.com>
To: www-xsl-fo@w3.org
Hi,
 
I started using xsl-fo some weeks ago when trying to write own xml and xsl file for pdf-document creation via 'fop'.
 
What I would like to get is a title page plus the rest of a document. But I have problems to write an appropriate xsl file.
How can I get a title page, which contents comes from XML file in the block <titlepage>  </titlepage>?
I don't know how to associate a 'simple-page-master' with a XML block like <titlepage> ..... </titlepage> or if it is really possible.
 
Maybe somebody of you know how the XSL semantic could be. 
Here the the XSL-code I used so far.
 
Thanks in advance.
 
Franz
 
.....
  <fo:layout-master-set>
    <fo:simple-page-master master-name="first"
      page-height="297mm" page-width="210mm"
      margin-top="20mm" margin-bottom="20mm"
      margin-left="25mm" margin-right="25mm">
      <fo:region-body margin-bottom="20mm"/>
      <fo:region-after region-name="footer-first" extent="20mm"/>
    </fo:simple-page-master>
    
    
    <fo:simple-page-master master-name="rest"
      page-height="297mm" page-width="210mm"
      margin-top="20mm" margin-bottom="20mm"
      margin-left="25mm" margin-right="25mm">
      <fo:region-body margin-bottom="20mm"/>
      <fo:region-after region-name="footer-rest" extent="20mm"/>
    </fo:simple-page-master>
   
  <fo:page-sequence-master master-name="document">
      <fo:repeatable-page-master-alternatives>
        <fo:conditional-page-master-reference page-position="first"
          master-reference="first"/>
        <fo:conditional-page-master-reference page-position="rest"
          master-reference="rest"/>
      </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>     
    
  </fo:layout-master-set>    
 
  <fo:page-sequence master-reference="document">
    <fo:static-content flow-name="footer-first">
      <fo:block text-align="center">First page.      
      </fo:block>
    </fo:static-content>
      <fo:static-content flow-name="footer-rest">
        <fo:block>
          <xsl:text>Page </xsl:text>
          <fo:page-number/>
        </fo:block>
      </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
      <fo:block/>
      <fo:block break-before="page"/>
        <!-- create the table of contents -->
        <xsl:apply-templates select="chapter/title" mode="toc"/>
        <!-- do the document -->
        <xsl:apply-templates/>
      <fo:block break-before="page"/>
    </fo:flow>
  </fo:page-sequence>
</fo:root>
</xsl:template>
........ 
----------------------------end of XSL file  ------------------------------------------
--------------------- part of the XML file --------------------
....
  <titlepage>
    <title>Spanish Review Handbook</title>
  </titlepage>
........
----------------- end of XML file
 
 
 



---------------------------------
Gesendet von http://mail.yahoo.de
Schneller als Mail - der neue Yahoo! Messenger.
Received on Thursday, 8 January 2004 14:07:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:12 GMT