Thanks a lot Ken.
The solution does work.
But there is a problem.
If there are 2 chapters, each consisting of 3 pages then it is printing
7 pages. The 4th one is being printed as blank.
I have removed the page break and there is no forced page break in the code.
Any idea?
Arun
From: "G. Ken Holman" <gkholman(_at_)CraneSoftwrights(_dot_)com>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] How to apply different page master
Date: Tue, 08 Feb 2005 07:39:42 -0500
At 2005-02-08 12:13 +0000, Arun Sinha wrote:
For each chapter I need to print different heading as chapter title and
restart the page
numbering for starting from 1.
The number of chapters are not known.
I tried setting the following page sequence :-
<fo:layout-master-set>
<fo:simple-page-master
master-name="document"
page-height ="297mm"
page-width ="210mm"
margin-left ="2mm"
margin-right ="2mm">
<fo:region-body margin-top="100mm" margin-bottom="5mm" />
<fo:region-before extent="99mm"/>
<fo:region-after extent="4mm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="chapter">
<xsl:for-each select="/document/chapter">
<fo:repeatable-page-master-reference
master-reference="document" />
</xsl:for-each>
The above is not necessary ... you need only specify page-sequence-master
if you have changing page region geometry or perimeter region content.
Since you have but one page master, you can simply point to it.
<fo:flow flow-name="xsl-region-body">
<fo:block break-before="page" />
......
</fo:flow>
</fo:page-sequence>
But it doesn't work. It is printing only one page even if there is a break
specified.
A page-sequence begins a new page. In your block you are specifying "this
block must begin a new page" ... that condition is satisfied, so there is
no blank page. Specifying break-before= is specifying a condition to be
met, not a command to be executed.
Is it the right way to apply different page sequence for different
chapter?
You don't give a lot of context, but working from the root node you need
only do:
<xsl:for-each select="/document/chapter">
<fo:page-sequence master-reference="document" initial-page-number="1">
<fo:static-content flow-name="xsl-region-before">...
<fo:static-content flow-name="xsl-region-after">...
<fo:flow flow-name="xsl-region-body">
....
</fo:flow>
</fo:page-sequence>
</xsl:for-each>
I hope this helps.
............................. Ken
--
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers: http://www.CraneSoftwrights.com/legal
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
_________________________________________________________________
Redefine team work. Discover your true potential.
http://www.microsoft.com/india/office/experience/ With the MS product suite.
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--