title: XSL-FO fo:repeatable-page-master-alternatives not working properly
body: <p>I want to add the page number in footer if the number of pages is more than one, but not for if there is only one page.</p>
  
  <p>I tried the following code but it shows the page number in all cases : </p>
  
  <pre><code>&lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;
          &lt;fo:layout-master-set&gt;
              &lt;fo:simple-page-master master-name="singlePage" page-height="800pt" page-width="612pt" margin-top="0pt" margin-bottom="46pt" margin-left="26pt" margin-right="26pt"&gt;
                  &lt;fo:region-body margin-top="110pt" margin-bottom="65pt" /&gt;
                  &lt;fo:region-before extent="72pt" /&gt;
                  &lt;fo:region-after region-name="xsl-region-after-single" extent="75pt" /&gt;
              &lt;/fo:simple-page-master&gt;
  
              &lt;fo:simple-page-master master-name="multiPage" page-height="800pt" page-width="612pt" margin-top="0pt" margin-bottom="46pt" margin-left="26pt" margin-right="26pt"&gt;
                  &lt;fo:region-body margin-top="110pt" margin-bottom="65pt" /&gt;
                  &lt;fo:region-before extent="72pt" /&gt;
                  &lt;fo:region-after region-name="xsl-region-after-multi" extent="75pt" /&gt;
              &lt;/fo:simple-page-master&gt;
  
              &lt;fo:page-sequence-master master-name="allPages"&gt;
                  &lt;fo:repeatable-page-master-alternatives&gt;
                     &lt;fo:conditional-page-master-reference page-position="any" master-reference="multiPage"/&gt;
                     &lt;fo:conditional-page-master-reference page-position="only" master-reference="singlePage"/&gt;
                  &lt;/fo:repeatable-page-master-alternatives&gt;
              &lt;/fo:page-sequence-master&gt;
          &lt;/fo:layout-master-set&gt;
  
          &lt;fo:page-sequence master-reference="allPages"&gt;
              &lt;fo:static-content flow-name="xsl-region-before"&gt;
                  &lt;fo:block&gt;content&lt;/fo:block&gt;
              &lt;/fo:static-content&gt;
              &lt;fo:static-content flow-name="xsl-region-after-single"&gt;
                  &lt;fo:block&gt;content&lt;/fo:block&gt;
              &lt;/fo:static-content&gt;
              &lt;fo:static-content flow-name="xsl-region-after-multi"&gt;
                      &lt;fo:block&gt;content&lt;/fo:block&gt;
                      &lt;fo:block text-align="right"&gt;
                          &lt;fo:inline&gt;&lt;fo:page-number font-weight="normal"/&gt;/&lt;fo:page-number-citation ref-id = "lastPage"/&gt;&lt;/fo:inline&gt;
                      &lt;/fo:block&gt;
              &lt;/fo:static-content&gt;
              &lt;fo:flow flow-name="xsl-region-body" font-size="12pt" line-height="11pt"&gt;
                  &lt;fo:block&gt;content&lt;/fo:block&gt;
                  &lt;fo:block id = "lastPage"/&gt;
              &lt;/fo:flow&gt;
          &lt;/fo:page-sequence&gt;
      &lt;/fo:root&gt;
  </code></pre>
  
  <p>If I change the order of alternatives, then page number is never shown:</p>
  
  <pre><code>&lt;fo:page-sequence-master master-name="allPages"&gt;
      &lt;fo:repeatable-page-master-alternatives&gt;
          &lt;fo:conditional-page-master-reference page-position="only" master-reference="singlePage"/&gt;
          &lt;fo:conditional-page-master-reference page-position="any" master-reference="multiPage"/&gt;
      &lt;/fo:repeatable-page-master-alternatives&gt;
  &lt;/fo:page-sequence-master&gt;
  </code></pre>
  
  <p>I'm using FOP 2.0</p>
  
  <p>Thanks for your answers.</p>