[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] RE: Trying to use fo:page-number-citation to set the initial-page-number of the next page-sequence


Subject: [xsl] RE: Trying to use fo:page-number-citation to set the initial-page-number of the next page-sequence
From: Underwood Michelle <michelle.underwood@xxxxxxxxxxxxxxx>
Date: Mon, 11 Jun 2012 11:55:45 -0700

Ken,

Thank you for your replies.

>Unrelated to your question, for performance reasons on some
>processors you might wish to review your use of "//" in the following:

These are part of the generated code in the GUI development environment and I
can't change them. This IDE separates the creation into several parts:
Layouts, Styleset, Business Object (data model based on xml/schema) and
finally the DDV where the content is all brought together and the other parts
applied to it.

I think the error message is because I 'hard-coded' that choose in there
instead of using the GUI interface and the program doesn't like it. Or, it
could be that you can't nest choose statements. I'm not sure which. The choose
I posted is inside another choose statement that checks on whether this is
duplex or simplex printing because if it is simplex then there is no need to
worry about pagination. It is also inside the page-sequence tags. I may try
making a variable and putting the choose outside the other and using the
variable inside the page-sequence tags to see if this stops the error. Maybe I
can set an Include_Section Boolean that is manipulated by the DDV document
script and used to set  initPageNbr (set to "auto" or the page number
reference) and hasBlankPage (Boolean used to determine how to set the
force-page) variables.

>One cannot use the end result of citing a page number as the value
>for an initial page number in a page sequence.

My question is, why not as long as the referenced page number is generated
before the referencing page? Is the value of the initial page number evaluated
at transform or render? I am assuming render since page numbers aren't known
until then. If they are evaluated at transform, how is this put into the xml
file to indicate it to the renderer and can that be manipulated between the
two? I have read about two pass processing but I am not sure where that
happens and the vendor for the IDE states that they would need to develop a
special handler, for a fee, that I assume does this two pass transformation or
render.

If it can't be done with page number references, how can this be done? I am
currently doing this using a variable that I set in the code of the DDV
(document created by the GUI) but that requires me to accurately predict in
development the number of pages that will be generated at runtime. I want this
to be 'automatic' rather than programmatic.

> ... I note this bizarre sequence in your fragment:
>
>><xsl:attribute name="initial-page-number">
>>         <xsl:value-of select="'fo:page-number-citation
>> ref-id='TH_BlankPage' xmlns:fo='http://www.w3.org/1999/XSL/Format''"/>
>></xsl:attribute>
>

This bizarre sequence is my newby attempt to accomplish the following:

I understand that the xslt processing happens at a different time than the
xsl:fo processing (transform vs render) but I'm looking for a way to tell the
renderer which initial page number to use based on the outcome of the
xsl:choose so that the renderer either uses "auto" or looks at the page number
of the referenced fo:block id to determine the starting page number of the
next section if there is a blank page inserted between them. Likewise, there
must be a way to change the page force based on the outcome of the transform
such as whether or not there is any content in Section 2.

Here is the Use Case (or requirement statement), setup, and examples:

I need a single output file that contains 2 or 3 sections having a common,
continuous page numbering where Section 1 must have an initial page number of
1, start-on-odd, and, unless the optional Section 2 exists, end-on-even, but
if Section 2 exists then Section 1 and 2 must be continuous without blank
pages between them and, in regards to page number and ending page force,
become one Section, but because they may have slightly different footer
content they must each have a separate static fo:block for the region-after,
and when put together they must end-on-even so that Section 3 physically
begins on an separate piece of paper when printed in duplex mode and will
end-on-even, even if the logical page numbering says that this is an odd
numbered page because the page numbering must logically start with the next
page number that follows the end of Section 1-2 regardless of whether a blank
page is inserted before it causing there to be a difference between the
physical page number and the logic page number.

I am attempting to dynamically set the starting page numbers so that the "Page
# of [total]" on each page accurately reflects only those pages which have
content.

Here is what I am doing to attempt this:

Section 1 has an empty block at the end of the flow marked TH_EndFlow.
The alternate simple-page-master (any, blank) for Section 1 has a footer
region named BlankFooter.

Section 2 has an empty block at the end of the flow marked TH_EndFlow2.
The alternate simple-page-master (any, blank) for Section 2 has a footer
region named BlankFooter.

Section 3 has an empty block at the end of the flow marked TH_EndForm.
The alternate simple-page-master (any, blank) for Section 3 has no name for
the footer region.

In the page-sequence for each of Sections 1 and 2 static-content: BlankFooter
has an fo:block with id = TH_BlankPage but these are not mapped to or used to
hold any content and a single document cannot have both fo:blocks in it
because they have the same id.

Section 1 has an initial preset to force-page-count=end-on-even and
initial-page-number=1.
Section 2 has an initial preset to force-page-count=end-on-even and
initial-page-number=auto.
Section 3 has an initial preset to force-page-count=end-on-even and
initial-page-number=auto.

I need Section 1 to end-on-even only if Section 2 does not exist so that there
is only one fo:block with the id of TH_BlankPage in the resulting document. If
Section 2 exists I need to change this attribute to "no-force" or "auto", I'm
not sure which.

If there is a blank page at the end of Section 1, or the combined Section 1-2,
I need Section 3 to have the starting page number that is the same as the page
number of TH_BlankPage, which is always the preceding page if that helps any.

In other words, If Section 2 is included, Sections 1 and 2 flow together when
printed in duplex (both sides of the paper) and insert only one blank page, if
needed, that falls between them and Section 3, so that Section 3 starts on the
front of the page, but continue the same page numbering without counting that
blank page.

Output examples:

Section 1 = even
Section 2 = none
Section 3 = odd

Section 1 pages are numbered Page 1 of 7, through 4 of 7.
Section 3 pages are numbered Page 5 of 7 through 7 of 7 and there is a blank
page as physical and logical page 8.

Section 1 = even
Section 2 = none
Section 3 = even

Section 1 pages are numbered Page 1 of 8, through 4 of 8.
Section 3 pages are numbered Page 5 of 8 through 7 of 8. (There are 8 pages,
both physically and logically)

Section 1 = odd
Section 2 = none
Section 3 = even

Section 1 pages are numbered Page 1 of 7, through 5 of 7.
Physical page 6 is a blank page that is not included in the total page count.
Section 3 pages are numbered Page 6 of 7 through 7 of 7,  as physical page 8,
and there is no blank page at the end.

Section 1 = odd
Section 2 = none
Section 3 = odd

Section 1 pages are numbered Page 1 of 8, through 5 of 8.
Physical page 6 is a blank page that is not included in the total page count.
Section 3 pages are numbered Page 6 of 8 through 7 of 8,  as physical page 9,
and there is a blank page at the end as physical page 10.

Section 1 = even
Section 2 = even
Section 3 = even

Section 1 pages are numbered Page 1 of 8, through 2 of 8.
Section 2 pages are numbered Page 3 of 8, through 4 of 8.
Section 3 pages are numbered Page 5 of 8 through 8 of 8 and there is no blank
page at the end. (8 pages both physically and logically).

Section 1 = even
Section 2 = even
Section 3 = odd

Section 1 pages are numbered Page 1 of 7, through 2 of 7.
Section 2 pages are numbered Page 3 of 7, through 4 of 7.
Section 3 pages are numbered Page 5 of 7 through 7 of 7 and there is a blank
page as page 8 (both physically and logically).


Section 1 = even
Section 2 = odd
Section 3 = even

Section 1 pages are numbered Page 1 of 7, through 4 of 7.
Section 2 pages are numbered Page 5 of 7, through 5 of 7.
Physical page 6 is a blank page that is not included in the total page count.
Section 3 pages are numbered Page 6 of 7 through 7 of 7,  as physical page 8,
and there is no blank page at the end (end-on-odd) which is physical page 8
but logical page 7.

Section 1 = odd
Section 2 = even
Section 3 = even

Section 1 pages are numbered Page 1 of 7, through 3 of 7. (Ends on odd but no
blank page inserted)
Section 2 pages are numbered Page 4 of 7, through 5 of 7.
Physical page 6 is a blank page that is not included in the total page count.
Section 3 pages are numbered Page 6 of 7 through 7 of 7,  as physical page 8,
and there is no blank page at the end (end-on-odd) which is physical page 8
but logical page 7.

Section 1 = odd
Section 2 = even
Section 3 = odd

Section 1 pages are numbered Page 1 of 8, through 3 of 8. (Ends on odd but no
blank page inserted)
Section 2 pages are numbered Page 4 of 8, through 5 of 8.
Physical page 6 is a blank page that is not included in the total page count.
Section 3 pages are numbered Page 6 of 8 through 8 of 8,  as physical page 9,
and there is one blank page at the end (end-on-odd) which is physical page 10
but logical page 9.

Section 1 = odd
Section 2 = odd
Section 3 = even

Section 1 pages are numbered Page 1 of 8, through 3 of 8. (Ends on odd but no
blank page inserted)
Section 2 pages are numbered Page 4 of 8, through 4 of 8.
Section 3 pages are numbered Page 5 of 8 through 8 of 8. (8 pages both
logically and physically)

Section 1 = odd
Section 2 = odd
Section 3 = odd

Section 1 pages are numbered Page 1 of 7, through 3 of 7. (Ends on odd but no
blank page inserted)
Section 2 pages are numbered Page 4 of 7, through 4 of 7.
Section 3 pages are numbered Page 5 of 7 through 7 of 7. Blank page at end as
page 8 both logically and physically.

Thank you,

Michelle

P.S. I hope I did this reply correctly so that it posts to the correct thread.
This is my first time using an email chain forum.

-----Original Message-----
From: xsl-list-digest-help@xxxxxxxxxxxxxxxxxxxxxx
[mailto:xsl-list-digest-help@xxxxxxxxxxxxxxxxxxxxxx]
Sent: Friday, June 08, 2012 10:10 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: xsl-list Digest 9 Jun 2012 05:10:02 -0000 Issue 2850

Date: Fri, 08 Jun 2012 21:19:05 -0400
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx,
 "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: [xsl] Trying to use fo:page-number-citation to set the
  initial-page-number of the next page-sequence
Message-Id: <7.0.1.0.2.20120608210915.02463a60@xxxxxxxxxxxxxxxxxxxxxx>

------------------------------

End of xsl-list Digest
***********************************

*****CONFIDENTIALITY  NOTICE*****

This e-mail may contain information that is privileged, confidential, or
otherwise exempt from disclosure under applicable law. If you are not the
addressee or it appears from the context or otherwise that you have received
this e-mail in error, please advise me immediately by reply e-mail, keep the
contents confidential, and immediately delete the message and any attachments
from your system.

************************************


Current Thread
Keywords