XSL-FO Document
XSL-FO Document
An XSL-FO document is an XML file with output information.
XSL-FO documents are stored in files with the .fo or .fob file extensions. You can also store XSL-FO documents as files with the .xml extension, which makes them more accessible to XML editors.
XSL-FO Document Structure
The structure of an XSL-FO document is as follows:
Structure Explanation
An XSL-FO document is an XML document, so it must start with an XML declaration:
The <fo:root> element is the root element of the XSL-FO document. This root element must also declare the XSL-FO namespace:
The <fo:layout-master-set> element contains one or more page templates:
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" for master-reference does not actually describe a predefined page format. It is just a name. You can use any name, such as "MyPage", "MyTemplate", etc.