There is no bug. Please read the "Constraints" section of:
http://www.w3.org/TR/xsl11/#fo_repeatable-page-master-alternatives

the key part: "(d) that alternative is the first alternative in the
sequence of children for which all the conditions are true"

That means you have to put most constrained alternatives first and the
more general ones after that. In your example, there is only a master
reference for the first and the last page. The FO processor then doesn't
know what to do with the other pages in between.

If you need special page-masters for the first and last page, you have
to do something like the following. Note again, that the order of the
conditional-page-master-references is important. For the third I've
omitted the page-position property because it defaults to "any".

<fo:repeatable-page-master-alternatives>
  <fo:conditional-page-master-reference master-reference="first-page"
                   page-position="first"/>
  <fo:conditional-page-master-reference master-reference="last-page"
                  page-position="last"/>
  <fo:conditional-page-master-reference master-reference="normal-page"/>
</fo:repeatable-page-master-alternatives>


On 11.12.2007 15:14:38 Jerzy Jalocha N wrote:
> I have a two-page document with two 'simple-page-master's, one for the
> first page, and one for the last one. When I use a conditional
> sequence with 'repeatable-page-master-alternatives', and I don't
> provide a default 'conditional-page-master-reference', FOP complains
> about "subsequences exhausted in page-sequence-master", and crashes.
> 
> As seen in the example below, it is easy to circumvent the problem by
> providing a default, but I'm not sure if this behavior is expected, or
> a bug. The specification doesn't seem to require a default
> (http://www.w3.org/TR/xsl/#fo_conditional-page-master-reference).
> 
> More in general, I have the following question. Since I'm new to both
> FOP and XSL-FO, I am quite prone to breaking things. Is it OK to
> report them here when I think I might have found a bug? Or shall I
> wait until I have more expertise?
> 
> Thanks in advance,
> -Jerzy
> 
> 
> <?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="first-page"
>             page-height="11in" page-width="8.5in"
>             margin-top="0mm" margin-left="0mm" margin-right="0mm"
> margin-bottom="0mm">
>          <fo:region-body
>                border-style="none"
>                margin-top="80mm" margin-bottom="20mm"
> margin-left="20mm" margin-right="20mm"/>
>          <fo:region-before region-name="first-region-before"
>                border-style="none"/>
>          <fo:region-after region-name="first-region-after"
>                border-style="none"/>
>       </fo:simple-page-master>
> 
>       <fo:simple-page-master master-name="last-page"
>             page-height="11in" page-width="8.5in"
>             margin-top="0mm" margin-left="0mm" margin-right="0mm"
> margin-bottom="0mm">
>          <fo:region-body
>                border-style="none"
>                margin-top="40mm" margin-bottom="20mm"
> margin-left="20mm" margin-right="20mm"/>
>          <fo:region-before region-name="last-region-before"
>                border-style="none"/>
>          <fo:region-after region-name="last-region-after"
>                border-style="none"/>
>       </fo:simple-page-master>
> 
>       <fo:page-sequence-master master-name="document-sequence">
>          <fo:repeatable-page-master-alternatives>
>             <fo:conditional-page-master-reference 
> master-reference="first-page"
>                   page-position="first"/>
> <!-- Enable this default in order to make it work with FOP.
>             <fo:conditional-page-master-reference master-reference="last-page"
>                   page-position="rest"/>
> -->
>             <fo:conditional-page-master-reference master-reference="last-page"
>                   page-position="last"/>
>          </fo:repeatable-page-master-alternatives>
>       </fo:page-sequence-master>
> 
>    </fo:layout-master-set>
> 
> 
>    <fo:page-sequence master-reference="document-sequence">
> 
>       <fo:flow flow-name="xsl-region-body"
>             font-size="11pt">
> 
> <!-- Please, fill two pages with 15 copies of this block: -->
> 
>          <fo:block>Lorem ipsum dolor sit amet, consectetur adipisicing
> elit, sed do eiusmod tempor incididunt ut labore et dolore magna
> aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
> laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
> in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
> pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
> culpa qui officia deserunt mollit anim id est laborum.</fo:block>
> 
>       </fo:flow>
> 
>    </fo:page-sequence>
> </fo:root>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to