XSL-FO Output

XSL-FO defines output within the <fo:flow> element.

XSL-FO Page, Flow, and Block

Content 'blocks' flow into 'pages' and are then output to the medium.

XSL-FO output is usually nested within <fo:block> elements, which are nested within <fo:flow> elements, and these are further nested within <fo:page-sequence> elements:

<fo:page-sequence>
  <fo:flow flow-name="xsl-region-body">
    <fo:block>
      <!-- Output goes here -->
    </fo:block>
  </fo:flow>
</fo:page-sequence>

XSL-FO Example

Let's take a look at a real XSL-FO example:

<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
  <fo:simple-page-master master-name="A4">
  </fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
  <fo:flow flow-name="xsl-region-body">
    <fo:block>Hello CodeW3C.com</fo:block>
  </fo:flow>
</fo:page-sequence>
</fo:root>

The output of the above code is similar to this: