473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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 5296
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********************@speakeasy.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
"$initialPageNumber" that i pre-defined, it gives the error below:

javax.xml.transform.TransformerException: org.apache.fop.apps.FOPException:
The value '$initialPageNumber' is not valid for initial-page-number

any idea how i can pass a variable here?
thanks a bunch
hilz
"john farrow" <jo*********@xmldpf.com> wrote in message
news:mr********************@news02.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********************@speakeasy.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.com> wrote:
"john farrow" <jo*********@xmldpf.com> wrote in message
news:mr********************@news02.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
"$initialPageNumber" 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="$initialPageNumber">

when what you meant was:

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

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="$initialPageNumber">

when what you meant was:

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

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:attribute name="initial-page-number"><xsl:value-of
select="$startingPageNumber"/></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
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
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
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
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....
7
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
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 -...
4
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
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>...
6
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.