XSL-FO Uitvoer

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, which are nested within <fo:page-sequence> elements:

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

XSL-FO Voorbeeld

Laten we nu een echte XSL-FO voorbeeld bekijken:

<?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>

De uitvoer van de bovenstaande code lijkt er zo uit: