Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 5th, 2011, 08:31 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSL:FO - additional "page number + 1" before empty page

Hi!
I'm new to the forums and I'm asking about XSL:FO, but maybe you are so incredibly kind and could help me out a bit, maybe just with an idea.

First off: we're using conditional page masters to control what's on which page, ie. even or odd pages, blank/empty or not blank like that:

Code:
<fo:conditional-page-master-reference master-reference="body.page.A4.any.even" odd-or-even="even" blank-or-not-blank="not-blank"/>
<fo:conditional-page-master-reference master-reference="body.page.A4.any.even.blank" odd-or-even="even" blank-or-not-blank="blank"/>
<fo:conditional-page-master-reference master-reference="body.page.A4.any.odd" odd-or-even="odd" blank-or-not-blank="not-blank"/>
<fo:conditional-page-master-reference master-reference="body.page.A4.any.odd.blank" odd-or-even="odd" blank-or-not-blank="blank"/>
And of course, my final pdf shows the actual page in the footer, but only on not-blank pages, like this:

Code:
|-----------|-----------|
|thisapage  |   somemore|
|fullof     |  ends here|
|sometext   |           |
|itsfull    |           |
| footer:   |   footer: |
| page 2    |    page 3 |
|-----------|-----------|
|           | a new page|
|           |   in a new|
|           |  page-sequ|
|           |       ence|
|           |   footer: |
|           |    page 5 |
|-----------|-----------|

TLDR: That's what I have.
So far, this works incredibly nice. But I need the page 3 to have some information about the empty page, ie. "page 4" should be added to the footer on page 3, so that you know the following page has been intentionally left blank (without actual text on the empty page) like this:

Code:
|-----------|-----------|
|thisapage  |   somemore|
|fullof     |  ends here|
|sometext   |           |
|itsfull    |           |
| footer:   |   footer: |
| page 2    |   page 3/4|
|-----------|-----------|
|           | a new page|
|           |   in a new|
|           |   page-seq|
|           |       ence|
|           |   footer: |
|           |    page 5 |
|-----------|-----------|

TLDR: That's what I need.
page 5 is just there for representational purposes (it would normally restart at 1 in our case), but it shows that I'm starting a new page-sequence afterwards.

For PDF creation, I'm using Arbortext Publishing Engine, and as such I cannot use page-position="last" which doesn't exactly help. Something like "<fo:page-number/> + 1" is not possible, of course.
I tried various things, but I'm out of ideas and for performance reasons, a complete 2-pass setting would only be the last of my options.


So if you have any idea what I could try or where a good place to ask would be, please, be so kind and let me know.

Thanks in advance!
Martin
Reply With Quote
  #2 (permalink)  
Old September 6th, 2011, 10:26 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I managed to figure it out myself, but i still got one more problem, this time a more simple question.



Is it possible to get a working page-number-citation (or something that looks like that) of a real fo-"blank" page?
If not, I use break-before="even-page" on an fo:block and then print something. Is there a way to only print something, ONLY if it had to do the break?


More detailed:
My problem is that when a page-sequence ends on an odd page - and no empty page has to be added - two extra empty pages are added instead of none. I think I understand why that is, but I can't really work around it right now.


Right now, I'm creating a marker at the end of each page-sequence (which is then in turn on the last, real page) and a block with a break-before and an ID. That ID then lands either on the blank page (which is weird, but what I want) or on another page some time later (which is my problem).
Luckily, when having an odd page and I need that output, the ID really does land on the blank page. So if there really was a blank page added/needed (because the page-sequence ended on an even page), it now has an ID that I can reference to.
But on even last content pages, ie. where the marker+block+pagebreak isn't even needed, this creates two additional and useless empty pages. The ID lands on the second empty page.

If I wouldn't print the nbsp, the extra pages won't get printed, but the ID-blocks are moved to the next page-sequence and the page-number-citation shows mostly "1" (which is correct, but... yea... kinda useless)


For reference, that's my code right now:

At the end of each page-sequence:
Code:
<fo:marker marker-class-name="emptymarker{generate-id()}"><fo:inline>/<fo:page-number-citation ref-id="empty{generate-id()}"/></fo:inline></fo:marker>
<fo:block span="all" break-before="even-page" id="empty{generate-id()}"> </fo:block>
In the footer of odd pages:
Code:
<fo:retrieve-marker retrieve-class-name="emptymarker{generate-id()}" retrieve-boundary="page-sequence"/>
So all in all, I know why this isn't working properly - but still, this would work if I wouldn't need the block after the marker and instead use an ID block that's already on the (possible, but not mandatory) following blank/empty page, like a unique one in a static content.
That's of course most of the time not really practical. And getting some content on a, well, content-less (blank) page sounds kind of insane, too.

Any ideas? Thanks!

PS: The output on the last few pages would look like this right now:
... 47, 48, 49/50, <empty no output>, 1, 2, ... ---- correct
... 31, 32/34, <empty>, <empty>, 1, 2, .... ---- wrong, don't need 2 empty pages. the /34 is only printed for debug purposes, because it's on a even page footer, not an odd one.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling the "Regsiter" action method using AJAX (page 122) lagonave BOOK: Professional ASP.NET MVC 2 24 December 12th, 2012 08:37 AM
Base Page Problem with "safeitenames" carryover in the 'inherits" johnandrewmcknight BOOK: Beginning ASP.NET 4 : in C# and VB 3 April 22nd, 2011 04:08 PM
Please help me "can’t open the page because the server where this page is located is" m_alsobaai ASP.NET 3.5 Professionals 1 April 10th, 2010 06:32 AM
Issue using "saxon:line-number()" in command line XSL with Saxon9.jar ROCXY XSLT 3 June 3rd, 2009 04:24 AM
how to assign fo:page-number to a xsl:variable or jyotsnag XSLT 0 March 14th, 2006 01:49 AM



All times are GMT -4. The time now is 05:10 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.