Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

XSL-FO output


May 28, 2021 XSL-FO


Table of contents


XSL-FO output

This section explains XSL-FO output to you, and you can use the examples in this section to understand XSL-FO output.

XSL-FO defines the output inside the element.


XSL-FO page (Page), Flow, and Block

The content "block" will "stream" into the page and then output to the media.

XSL-FO outputs are usually nested within the elements of the .lt;fo:block>

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


XSL-FO instance

Now let's 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:region-body />
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="A4">
<fo:flow flow-name="xsl-region-body">
<fo:block>Hello W3CSchool</fo:block>
</fo:flow>
</fo:page-sequence>

</fo:root> 

The output of the above code looks like this:

Hello W3CSchool 




This is an introduction to XSL-FO output.