title: How to align text with the bottom of an XSL-FO block?
body: <p>I am writing an XSLT script, that transforms an XML input document to an XSL-FO intermediate document, which get transformed into a PDF output document.</p>
  
  <p>My <code>fo:simple-page-master</code> exists out of three parts, a page header, body, and footer.</p>
  
  <pre><code>&lt;fo:layout-master-set&gt;
      &lt;fo:simple-page-master master-name="a4-portrait"
          page-width="210mm" page-height="297mm"
          margin-top="0mm" margin-right="12mm" margin-bottom="0mm" margin-left="12mm"&gt;
          &lt;fo:region-body region-name="page-body" margin-top="20mm" margin-bottom="20mm"/&gt;
          &lt;fo:region-before region-name="page-header" extent="20mm"/&gt;
          &lt;fo:region-after region-name="page-footer" extent="20mm"/&gt;
      &lt;/fo:simple-page-master&gt;
      &lt;fo:simple-page-master master-name="a4-landscape"
          page-width="297mm" page-height="210mm"
          margin-top="0mm" margin-right="12mm" margin-bottom="0mm" margin-left="12mm"&gt;
          &lt;fo:region-body region-name="page-body" margin-top="20mm" margin-bottom="20mm"/&gt;
          &lt;fo:region-before region-name="page-header" extent="20mm"/&gt;
          &lt;fo:region-after region-name="page-footer" extent="20mm"/&gt;
      &lt;/fo:simple-page-master&gt;
  &lt;/fo:layout-master-set&gt;
  </code></pre>
  
  <p>Here is a simple <em>hello world</em> page:</p>
  
  <pre><code>&lt;fo:page-sequence master-reference="a4-portrait"&gt;
      &lt;!-- Page header --&gt;
      &lt;fo:static-content flow-name="page-header"&gt;
          &lt;fo:block vertical-align="text-bottom"&gt;Some headline in the page header&lt;/fo:block&gt;
          &lt;fo:block vertical-align="text-bottom" border-bottom="0.25pt solid black"&gt;&lt;/fo:block&gt;
      &lt;/fo:static-content&gt;
  
      &lt;!-- Page footer --&gt;
      &lt;fo:static-content flow-name="page-footer"&gt;
          &lt;fo:block border-top="0.25pt solid black"&gt;&lt;/fo:block&gt;
          &lt;fo:block&gt;Page &lt;fo:page-number/&gt;&lt;/fo:block&gt;
      &lt;/fo:static-content&gt;
  
      &lt;!-- Page body --&gt;
      &lt;fo:flow flow-name="page-body"&gt;
          &lt;fo:block&gt;Hello World!&lt;/fo:block&gt;
      &lt;/fo:flow&gt;
  &lt;/fo:page-sequence&gt;
  </code></pre>
  
  <p>As you can see, I already tried the <code>vertical-align="text-bottom"</code> approach. Unfortunately, the <code>fo:block</code>-elements did not align to the bottom of the superordinate element.</p>
  
  <p><strong>How to write the XSLT in order to have the <code>page-header</code> writes the text from bottom to top, instead of top-to-bottom?</strong></p>
  
  <p>XSLT 2.0, XPath 2.0, Apache FOP, Saxon-HE 9.8</p>