Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xsl-fo starting page-number

Reply
Thread Tools

xsl-fo starting page-number

 
 
hilz
Guest
Posts: n/a
 
      02-11-2004
Hi all:
Is there a way to make the <foage-number> start from a value
different than 1 ? (using fop to generate pdf)

thanks
hilz



 
Reply With Quote
 
 
 
 
john farrow
Guest
Posts: n/a
 
      02-11-2004
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>

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

</fo:root>

Regards

John Farrow
http://www.xmlpdf.com


"hilz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all:
> Is there a way to make the <foage-number> start from a value
> different than 1 ? (using fop to generate pdf)
>
> thanks
> hilz
>
>
>



 
Reply With Quote
 
 
 
 
hilz
Guest
Posts: n/a
 
      02-12-2004
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" <(E-Mail Removed)> wrote in message
news:mryWb.23552$(E-Mail Removed)...
> 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>
>
> <foage-sequence master-reference="page" initial-page-number="19">
> <fo:flow flow-name="body">
> <fo:block >page number is <foage-number/></fo:block>
> </fo:flow>
> </foage-sequence>
>
> </fo:root>
>
> Regards
>
> John Farrow
> http://www.xmlpdf.com
>
>
> "hilz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi all:
> > Is there a way to make the <foage-number> start from a value
> > different than 1 ? (using fop to generate pdf)
> >
> > thanks
> > hilz
> >
> >
> >

>
>



 
Reply With Quote
 
Paul A. Hoadley
Guest
Posts: n/a
 
      02-12-2004
On Wed, 11 Feb 2004 19:36:19 -0500, hilz <(E-Mail Removed)> wrote:

> "john farrow" <(E-Mail Removed)> wrote in message
> news:mryWb.23552$(E-Mail Removed)...
>> 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>
>>
>> <foage-sequence master-reference="page" initial-page-number="19">
>> <fo:flow flow-name="body">
>> <fo:block >page number is <foage-number/></fo:block>
>> </fo:flow>
>> </foage-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:

<foage-sequence master-reference="page"
initial-page-number="$initialPageNumber">

when what you meant was:

<foage-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/
 
Reply With Quote
 
hilz
Guest
Posts: n/a
 
      02-12-2004

> 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:
>
> <foage-sequence master-reference="page"
> initial-page-number="$initialPageNumber">
>
> when what you meant was:
>
> <foage-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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C++ 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C Programming 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui Python 0 04-27-2009 12:46 PM
Starting a community? stlava The Lounge 5 07-01-2005 06:52 AM
d-link DWL-g650+ crashes windows at starting up =?Utf-8?B?cGhpbGlwIE1lcnJ5?= Wireless Networking 0 09-22-2004 01:53 PM



Advertisments