Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

XSL Foldouts - Mixed Page Flows


XSL Foldouts - Mixed Page Flows


I have a chapter with normal A4 page sizes but the last element is a
foldout and that has to be A3 size.

I think the page sequence and page postions are the key to solving this
riddle but in reality it isn't quiet working. I think the page sequence
should be first, odd, even, blank, foldout with every page set to A4
except the foldout which is A3.

My page positions are set as first = first. Odd, even and blank = any
and foldout = rest or last but that doesn't work.

I have setup the chapter to call-template="foldout" if
descedant::foldout which is working and calling out my foldout page
sequence but now I just need the page with the foldout A3 size.

Any suggestions would be greatly appreciated! Thank you. 🙂

Kind Regards,
Juliette Gibb
Technical Publisher
Airline Publications
Safety Systems Division
Virgin Blue Airlines

If the foldout is a separate element, or if there is some attribute on
the element that identifies it as a foldout, it seems to me that you
could use the existence of either of those as a trigger to start a new
page model, regardless of the page sequence defined in your stylesheet.
The start of the next chapter could switch back to the normal page

It sounds like you are using Styler, about which I know little, so
maybe what you want cannot be done in Styler. Somebody who knows Styler
might be able to help you more.

Oops, I see by the title of your original post that you are using XSL,
not Styler. I haven't used XSL-FO much, but it still seems that you
ought to be able to switch page models based on the existence of an
element or attribute on an element and define the scope of the new page
model, or just switch back to the regular page at the beginning of the
next chapter. You can do this in FOSI, it seems like you ought to be
able to do it in XSL as well.

Hi Juliette,

>>My page positions are set as first = first. Odd, even and blank = any and
foldout = rest >>or last but that doesn't work.

What you are attempting to do should be possible using XSL-FO, but it's hard
to tell exactly how the stylesheet is handling the page masters without
seeing your code. It looks like your "Odd, even and blank = any" may be
overriding the "foldout = rest or last."

You could try something like:

<fo:conditional-page-master-reference page-position="last" odd-or-even="any"&lt;br"/>master-reference="foldout"/>
<fo:conditional-page-master-reference page-position="rest" odd-or-even="any"&lt;br"/>master-reference="any"/>


I'm actually using XMLSpy not Styler - although if that is easier maybe
it would be worth trying it through that!

My foldout is a separate element but when I call out the separate page
sequence from that foldout element it crashes my computer. I think this
is because it's parent is setting the default page model and then it
gets to the foldout and I'm trying to change it. The only way I can get
it to read the foldout element itself is if I call-template foldout from
the actual element foldout so I'm just running it around in a circle

To reduce the circle a ibt I have tried using a condition statement on
the parent that says if the descendant is foldout then use the call
template="foldout if not then use the default page model - this does
work to a degree, I just need it to figure out if the page is a last odd
or even then to assign the correct page model to it.

This is how my page sequence is currenly set-up:
<fo:page-sequence-master master-name="foldout-page">

<fo:single-page-master-reference master-reference="first-foldout-master"&lt;br"/>odd-or-even="odd" page-position="first"/>

<fo:repeatable-page-master-reference<br/>master-reference="even-foldout-master" odd-or-even="even"

<fo:repeatable-page-master-reference<br/>master-reference="odd-foldout-master" odd-or-even="odd"


<fo:conditional-page-master-reference<br/>master-reference="foldout-master-even" odd-or-even="even"

<fo:conditional-page-master-reference<br/>master-reference="foldout-master-odd" odd-or-even="odd"



This format is giving me the A3 sized foldout pages but two of them not
just the one that is relevant to the actual page. I figure it's because
I need to use an if/when condition statement to find out if the
page-position is last and an odd page or an even page. But how do I do

Is it possible to find out if the page-position is last and an odd page
to use this:

<fo:conditional-page-master-reference<br/>master-reference="foldout-master-even" odd-or-even="even"

or if it is a page-position is last and an even page to do this:

<fo:conditional-page-master-reference<br/>master-reference="foldout-master-odd" odd-or-even="odd"

Thank You 🙂


I am not an XSL-FO expert, nor do I play one on TV. Your statement
about getting two A3-size pages instead of one confuses me a little (I'm
easily confused.). What about the back of the A3 page? I think you
need the back of the page if you are actually going to print it out,
otherwise, why have page sizes at all? Or, when you say you only want
"one page", do you mean you only want one piece of paper with a front
and a back page? Maybe I'm having a terminology problem between "page"
and "piece of paper".

P.S. I read somewhere about the dangers of mixing Altova and
PTC/Arbortext products. Sort of like "crossing the streams" in
"Ghostbusters". But seriously, I'm not sure how well you can utilize
something created with Altova XMLSpy with the Arbortext Editor
composition engine. Arbortext may assume some things that are not in
evidence to XMLSpy.

Hi Julliet,

I have a few questions that would help me better understand how you are
trying to create your foldout page sequence and why it's failing:

1. What XSLT processor are you using for the XML -> XSL-FO conversion? Are
you using Spy?s built in processor?
2. What rendering engine are you using to create the PDF?
3. Is the element that you are trying to assign the foldout page sequence to
nested within another element that is assigned to another page sequence?


Hi, Juliette...

To echo Ed (since the office we share isn't big enough for that to
happen on its own), I'm no XSL-FO expert, as we still use FOSI here.
I'm also not sure I completely understand your situation, but some of
your questions make me think you're not quite on the right track, so
I'll try to back up and fill in the gaps a bit, if I can. I apologize
if this is stuff you already know.

You mention a couple of times setting up a "condition statement" or an
"if/when" to handle things differently based on whether the foldout will
be an odd or even page. If you're talking about your XSLT, you won't be
able to do that. The XSLT transform is only responsible for
transforming your XML file, which generally uses "semantic" markup
(i.e., "this is an introduction", "this is an equipment list", "this is
a glossary entry", etc.) into page description markup (i.e., "this is a
paragraph", "this is a table", "this is a footnote", etc.). The
standard for page description markup that you're targeting is XSL-FO.
Another process, generally completely disconnected from the XSLT
processor, is responsible for taking that page description markup and
deciding where to put ink on paper as a result (or the virtual
equivalent of it, if you're making PDF without necessarily printing it

Because the XSLT processor doesn't know how to decide where the pages
will break and generally has no means to ask the process that will make
that decision, your page description markup needs to describe the page
sequence in a way that will give the layout process all the information
it needs whether your foldout ends up on an odd page or an even one.
This is what the page-sequence stuff is all about. It specifies one or
more page layouts, the order they're used in and any conditions that
might need to be met in order to pick one layout over another at any
given point in the sequence.

Based on the snippet you provided, it appears that your publication
requires a contiguous series of foldouts to start on an odd-numbered
page. Given that odd-numbered pages are generally on the right-hand
(a.k.a. recto, or front) side, this makes sense, as you would be
switching to a new paper size at that point and could not just squeeze
the foldout onto the left-hand (a.k.a. verso, or back) side of a
different-sized sheet of paper. However, unless there is something
different about the layout of the first page in a series of foldouts,
you should not need a different page-master for this page, as it should
be perfectly legal to have the layout engine issue one instance of the
master as the "first" page and additional instances of the same master
later on. This same point applies to your "last" page masters, which
should only be necessary if the layout of the final page in your series
of foldout pages needs to be different from all of the others.

Here's a big area where my lack of XSL-FO experience comes in. From a
quick look over the XSL-FO specification, I don't believe you're allowed
to specify "odd-or-even" or "page-position" attributes on
<fo:single-page-master-reference/> or
<fo:repeatable-page-master-reference/> elements. The spec only shows
these on the <fo:conditional-page-master-reference/> element. The idea
is that the "single" element will match the next page regardless of any
conditions and that the "repeatable" element will similarly match all
pages, up to the limit specified in the "maximum-repeats" attribute.
For a sequence of pages that needs to shift among two or more masters,
such as alternating even and odd, the
<fo:repeatable-page-master-alternatives/> is used, with each
"conditional" element specifying the conditions under which its
specified master is used. The selection process stops at the first
match, meaning that the more restrictive conditions need to be listed
first, such as page-position="last" coming before an
otherwise-equivalent page-position="any". Given all that, I'd rewrite
your example as follows:

<fo:page-sequence-master master-name="foldout-page">



<fo:conditional-page-master-reference<br/>master-reference="foldout-master-even" odd-or-even="even"

<fo:conditional-page-master-reference<br/>master-reference="foldout-master-odd" odd-or-even="odd"

<fo:conditional-page-master-reference<br/>master-reference="even-foldout-master" odd-or-even="even"

<fo:conditional-page-master-reference<br/>master-reference="odd-foldout-master" odd-or-even="odd"



Now, this does not specify that the first page needs to be odd-numbered.
That, I believe, would be accomplished via appropriate use (exact use
left as an exercise, or future Adepters question, for the reader) of the
"initial-page-number" and "force-page-count" attributes on the page
sequences for foldouts and the chapter preceding it. Also, I notice
that you don't seem to have a "blank" master, which I would expect in
this type of sequence so that things come out right if your last foldout
ends up on an odd page. However, such a master is not necessary if your
blank page looks just like any other even-numbered page, but without any
content (other than page numbers and such).

Hope this helps.

-Brandon 🙂