Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XSL-FO Documents

XSL-FO Documents


XSL-FO Documents

An XSL-FO document is an XML file with output information.

XSL-FO documents are stored in files with the .fo or .fob file extension. You can also store an XSL-FO document as a file with the .xml extension, which makes it easier for XML editors to access.


XSL-FO Document Structure

The structure of an XSL-FO document is as follows:

fo:layout-master-set

Structure explanation

An XSL-FO document is an XML document, so it must also begin with an XML declaration:

fo:root element is the root element of an XSL-FO document. This root element must also declare the XSL-FO namespace:

fo:layout-master-set element contains one or more page templates:

fo:layout-master-set

Each fo:simple-page-master element contains a single page template. Each template must have a unique name (master-name):

One or more fo:page-sequence elements can describe the page content. The master-reference attribute references the simple-page-master template using the same name:

**Note:** The value "A4" of master-reference does not actually describe a predefined page format. It is merely a name. You can use any name, such as "MyPage", "MyTemplate", etc.