Subject: Re: [xsl] Page-break/Static content From: Alexey Gokhberg <alexei@xxxxxxxxxx> Date: Thu, 28 Dec 2000 14:19:56 +0100 |
Tobi Kamke wrote: > > Hi all, > > I would like to create a stylesheet for a bill: On the first page there > should be only the name of the receiver, some text and other things. On the > second and the following pages there should be some static-content in the > region-before field (e.g. page-number ...) and then finally in the > region-body the single items of the bill. So my first problem is that I > have to different single-page-masters, one for the first page, the other > for the rest. I have now created the first page, but how can I enforce a > page-break? I tried this: > > <fo:page-sequence master-name="sequence"> > > <fo:flow flow-name="xsl-region-body"> > <xsl:apply-templates select="DOCUMENT/DATA" mode="FirstPage"/> > </fo:flow> > > <fo:block break-after="page"/> > > <fo:static-content flow-name="xsl-region-before"> > <fo:block-container height="3cm" width="7cm" top="0cm" left="0cm" > position="absolute"> > <fo:block font-family="serif" font-size="10pt" font-weight="bold"> > Some text > </fo:block> > </fo:block-container> > </fo:static-content> > > <fo:flow flow-name="xsl-region-body"> > <xsl:apply-templates select="DOCUMENT/ITEMS" mode="Rest"/> > </fo:flow> > > FOP 0.15 returns the error that the flow-names must be unique. What can I > do? Can someone help me? > According to the recent XSL draft, one and only one fo:flow element is allowed in the content of fo:page-sequence. You have two of them, which is wrong anyway. Futhermore, the <fo:block break-after="page"/> has the strange position, being outside any fo:flow and fo:static-content. You could try something like: <fo:page-sequence master-name="sequence"> <!-- Place your fo:static-content declarations here ... --> <fo:flow flow-name="xsl-region-body"> <xsl:apply-templates select="DOCUMENT/DATA" mode="FirstPage"/> <fo:block break-after="page"/> <xsl:apply-templates select="DOCUMENT/ITEMS" mode="Rest"/> </fo:flow> </fo:page-sequence> in order to achieve the proper page break inside the flow. You will need the page sequence master (fo:page-sequence-master) to define the separate layouts (incl. the static content) for the first page and for the rest of the document. Your layout master set will look like: <fo:layout-master-set> <fo:simple-page-master master-name="FirstPage" ...> <!-- master for the first page --> ... </fo:simple-page-master> <fo:simple-page-master master-name="Rest" ...> <!-- master for the first page --> ... </fo:simple-page-master> <fo:page-sequence-master master-name="sequence"> <fo:single-page-master-reference master-name="FirstPage"/> <fo:repeatable-page-master-reference master-name="Rest"/> </fo:page-sequence-master> </fo:layout-master-set> This technique is demonstrated in details in the example of the telephone bill included in the distribution of our XSL formatter (available at http://www.unicorn-enterprises.com/ufo_1_00_01.zip); you might find this example useful. Alternative (and probably simpler, but stylistically inferior) solution is using several page-sequences within the same document; the stylesheet fragment would look like: <fo:page-sequence master-name="FirstPage"> <!-- Place your fo:static-content declarations here ... --> <fo:flow flow-name="xsl-region-body"> <xsl:apply-templates select="DOCUMENT/DATA" mode="FirstPage"/> </fo:flow> </fo:page-sequence> <fo:page-sequence master-name="Rest"> <!-- Place your fo:static-content declarations here ... --> <fo:flow flow-name="xsl-region-body"> <xsl:apply-templates select="DOCUMENT/ITEMS" mode="Rest"/> </fo:flow> </fo:page-sequence> In this case you will need two different simple page masters (named "FirstPage" and "Rest" in this example) to define the correct static content. Regards, Alexey Gokhberg Unicorn Enterprises SA XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Page-break/Static content, Tobi Kamke | Thread | Re: [xsl] Page-break/Static content, Tobi Kamke |
FW: [xsl] random output from a xml , Jarno Elovirta | Date | [xsl] Node positions with xsl:numbe, Bill Shaw - EBCX |
Month |