473,657 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xsl-fo starting page-number

Hi all:
Is there a way to make the <fo:page-number> start from a value
different than 1 ? (using fop to generate pdf)

thanks
hilz

Jul 20 '05 #1
4 5315
Set the initial-page-number attribute like this:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="page">
<fo:region-body margin='2.5cm' region-name="body"/>
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="page " initial-page-number="19">
<fo:flow flow-name="body">
<fo:block >page number is <fo:page-number/></fo:block>
</fo:flow>
</fo:page-sequence>

</fo:root>

Regards

John Farrow
http://www.xmlpdf.com
"hilz" <no****@nowhere .com> wrote in message
news:k5******** ************@sp eakeasy.net...
Hi all:
Is there a way to make the <fo:page-number> start from a value
different than 1 ? (using fop to generate pdf)

thanks
hilz

Jul 20 '05 #2
John,
Thank you so much for the quick answer.
I tired it and it worked great.

Now when i try to substitute the number "19" with a variable
"$initialPageNu mber" that i pre-defined, it gives the error below:

javax.xml.trans form.Transforme rException: org.apache.fop. apps.FOPExcepti on:
The value '$initialPageNu mber' is not valid for initial-page-number

any idea how i can pass a variable here?
thanks a bunch
hilz
"john farrow" <jo*********@xm ldpf.com> wrote in message
news:mr******** ************@ne ws02.tsnz.net.. .
Set the initial-page-number attribute like this:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="page">
<fo:region-body margin='2.5cm' region-name="body"/>
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="page " initial-page-number="19">
<fo:flow flow-name="body">
<fo:block >page number is <fo:page-number/></fo:block>
</fo:flow>
</fo:page-sequence>

</fo:root>

Regards

John Farrow
http://www.xmlpdf.com
"hilz" <no****@nowhere .com> wrote in message
news:k5******** ************@sp eakeasy.net...
Hi all:
Is there a way to make the <fo:page-number> start from a value
different than 1 ? (using fop to generate pdf)

thanks
hilz


Jul 20 '05 #3
On Wed, 11 Feb 2004 19:36:19 -0500, hilz <hi**@bilz.co m> wrote:
"john farrow" <jo*********@xm ldpf.com> wrote in message
news:mr******** ************@ne ws02.tsnz.net.. .
Set the initial-page-number attribute like this:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="page">
<fo:region-body margin='2.5cm' region-name="body"/>
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="page " initial-page-number="19">
<fo:flow flow-name="body">
<fo:block >page number is <fo:page-number/></fo:block>
</fo:flow>
</fo:page-sequence>

</fo:root>


Thank you so much for the quick answer.
I tired it and it worked great.

Now when i try to substitute the number "19" with a variable
"$initialPageNu mber" that i pre-defined, it gives the error below:


John's example is straight XSL-FO. Presumably what you're not telling
us is that you are writing an XSLT transform in which you're using a
variable, and presumably you've written something like:

<fo:page-sequence master-reference="page "
initial-page-number="$initia lPageNumber">

when what you meant was:

<fo:page-sequence master-reference="page "
initial-page-number="{$initi alPageNumber}">

Of course, I'm just guessing because you didn't post any code.
--
Paul.

Logic Squad -- Technical Publishing with XML -- http://logicsquad.net/
Jul 20 '05 #4
John's example is straight XSL-FO. Presumably what you're not telling
us is that you are writing an XSLT transform in which you're using a
variable, and presumably you've written something like:

<fo:page-sequence master-reference="page "
initial-page-number="$initia lPageNumber">

when what you meant was:

<fo:page-sequence master-reference="page "
initial-page-number="{$initi alPageNumber}">

Of course, I'm just guessing because you didn't post any code.


Paul, thanks for your answer.
Sorry for the ambiguity in my question.Yes I am using XSLT transformation
with an xml file to produce the fo then the pdf.
And your suggestion of placing the variable between {} worked great, thank
you. Another solution was to add it as an attribute element inside the
page-sequence element as below:

<xsl:attribut e name="initial-page-number"><xsl:va lue-of
select="$starti ngPageNumber"/></xsl:attribute>

Thanks
hilz
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1913
by: Buchleitner Martin | last post by:
Hi! I got another problem parsing my XML document: <document> <paragraph> <style val=listing/> <text>listing #1 text</text> </paragraph> <paragraph>
3
2070
by: will | last post by:
HOpe you can help with this... I have the following xml document... <?xml version="1.0" ?> <file> <header>some data</header> <detail> some more data</detail> <footer> gdshada </footer>
3
4467
by: Mikael Petterson | last post by:
Hi, I have the following in my xml file: <attribute name="bbBusState"> I need to generate to the following: public static final String BB_BUS_STATE_ATTR_TYPE.
4
2297
by: Jean-Christophe Michel | last post by:
Hi, In a complex merging of two (non ordered) xml files i need to keep track of the elements of the second tree that were already merged with first tree, to copy only unused elements at the end. I tried two solutions: * first is to 'substract' the used element from existing tree
7
3113
by: Andy Fish | last post by:
Hi, I'm stuck with an XSL problem - can anyone give me any hints? I have some XML with nested formatting tags like this: <text> this is plain <bold> this is bold
8
2356
by: Sebastian Kerekes | last post by:
Greetings, I'm developing an application that supports multiple languages. In my XSL I use variables to place the text where it belongs to. At the top of the document I include those variables - the included file depends on the language. Atm I'm editing those file manually. Luckily atm it's only two languages I have to work with, but even in this case I forget to add a variable that I added in the other file, forget to use entities .....
4
3445
by: Pat Turner | last post by:
Hi, I have some XML like this: <family> <person name="bob"> <father ref="../../person" /> </person> <person name="charlie"> <child ref="../../person" />
11
1911
by: Rolf Barbakken | last post by:
I have an xml with records like this one: <a:response> <a:href>http://server/public/sol/comp/1049306.eml</a:href> <a:propstat> <a:status>HTTP/1.1 200 OK</a:status> <a:prop> <d:customerid>1049306</d:customerid> <e:professioncode b:dt="mv.string"> <c:v>byggtapetserarbeider</c:v>
6
2156
by: Mark Miller | last post by:
I have a scheduled job that uses different XSL templates to transform XML and save it to disk. I am having problems with the code below. The problem shows up on both my development machine (Windows XP Pro SP 1, .Net Framework 1.1) and on our production server (Windows 2K SP 4, .Net Framework 1.1). I have simplified the code and data to isolate the problem. When I use the xsl:strip-space (Line 12) declaration in conjunction with the xsl:sort...
4
4333
by: Christofer Dutz | last post by:
Hi, I am having a small problem, that is driving me nuts. My application reads some Xml and runs 2 Xsl Transformations to generate HTML. As soon as my second XSL introduces some <br/tags, the application crashes with the same error message I would get when writing <brand no closing tag. To make everything a little stranger, even <br></brseems to be bad while <lbr/is fine. Ive tried some other tag names and the problem only appears with...
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.