Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 1st, 2008, 08:43 AM
Registered User
 
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSL Fo: Forcing page numbers

Hi

I am new to fo and am facing a peculiar problem that I am not able to resolve. The business requirement is such that I have a heading page that has a title and rest of the document (ROD) . The ROD page numbers have to start with Page number 1. .i.e Page 2 of the document should have the page number as 1. I wrote the Heading page and ROD in two different page-sequence. When I print this PDF after the first page I have a blank page appearing. This issue arises whenever I put initial-page-number="1" in the second page sequence. If I remove this the document works fine but the first page in ROD has Page number as 2. Any help in this scenario is helpful. Below is my code snippet

 <?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>

        <xsl:template match="/">
                <fo:root font-family="TimesNewRoman" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:rx="http://www.renderx.com/XSL/Extensions" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
                         xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office">
                        <fo:layout-master-set xmlns:v="urn:schemas-microsoft-com:vml" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
                                <fo:simple-page-master master-name="section1-first-page" page-width="8.5in" page-height="11in" margin-top="36pt" margin-bottom="36pt" margin-right="54pt" margin-left="45pt">
                                        <fo:region-body margin-top="36pt" margin-bottom="36pt"></fo:region-body>
                                        <fo:region-before region-name="first-page-header" extent="5in"></fo:region-before>
                                        <fo:region-after region-name="first-page-footer" extent="11in" display-align="after"></fo:region-after>
                                </fo:simple-page-master>
                                <fo:simple-page-master master-name="section1-odd-page" page-width="8.5in" page-height="11in" margin-top="36pt" margin-bottom="36pt" margin-right="54pt" margin-left="45pt">
                                        <fo:region-body margin-top="36pt" margin-bottom="36pt"></fo:region-body>
                                        <fo:region-before region-name="odd-page-header" extent="5in"></fo:region-before>
                                        <fo:region-after region-name="odd-page-footer" extent="11in" display-align="after"></fo:region-after>
                                </fo:simple-page-master>
                                <fo:simple-page-master master-name="section1-even-page" page-width="8.5in" page-height="11in" margin-top="36pt" margin-bottom="36pt" margin-right="54pt" margin-left="45pt">
                                        <fo:region-body margin-top="36pt" margin-bottom="36pt"></fo:region-body>
                                        <fo:region-before region-name="even-page-header" extent="5in"></fo:region-before>
                                        <fo:region-after region-name="even-page-footer" extent="11in" display-align="after"></fo:region-after>
                                </fo:simple-page-master>
                                <fo:page-sequence-master master-name="section1-page-sequence-master">
                                        <fo:repeatable-page-master-alternatives>
                                                <fo:conditional-page-master-reference odd-or-even="odd" master-reference="section1-odd-page"/>
                                                <fo:conditional-page-master-reference odd-or-even="even" master-reference="section1-even-page"/>
                                        </fo:repeatable-page-master-alternatives>
                                </fo:page-sequence-master>
                        </fo:layout-master-set>
                        <fo:page-sequence master-reference="section1-page-sequence-master" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:w10="urn:schemas-microsoft-com:office:word"
                                          xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
                                <fo:flow flow-name="xsl-region-body">
                                <fo:block><fo:inline>hello</fo:inline></fo:block>
                                </fo:flow>
                        </fo:page-sequence>

                                                <fo:page-sequence master-reference="section1-page-sequence-master" initial-page-number="1" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:w10="urn:schemas-microsoft-com:office:word"
                                          xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
                                <fo:flow flow-name="xsl-region-body1">
                                <fo:block><fo:inline>hello1</fo:inline></fo:block>
                                </fo:flow>
                        </fo:page-sequence>

                </fo:root>
        </xsl:template>
</xsl:stylesheet>







Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL-FO NEO1976 XML 2 July 19th, 2006 10:10 AM
xsl:fo with Select Birger XSLT 4 July 18th, 2006 11:38 AM
how to assign fo:page-number to a xsl:variable or jyotsnag XSLT 0 March 14th, 2006 01:49 AM
XSL-FO Question gray XSLT 1 February 18th, 2005 11:31 AM
hello, some problems with XSL-FO LuisMM XSLT 4 December 19th, 2003 02:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.