Xslfo Documents
# XSL-FO Documents
* * *
## XSL-FO Documents
An XSL-FO document is an XML file containing output information.
XSL-FO documents are stored in files with the file extension .fo or .fob. You can also store XSL-FO documents as files with the .xml extension. Doing so can make XSL-FO documents more accessible to XML editors.
* * *
## XSL-FO Document Structure
The structure of an XSL-FO document is as follows:
## Structure Explanation
XSL-FO documents are XML documents, so they must also start with an XML declaration:
The `` element is the root element of the XSL-FO document. This root element must also declare the XSL-FO namespace:
The `` element contains one or more page templates:
Each `` element contains a single page template. Each template must have a unique name (master-name):
One or more `` elements can describe the page content. The master-reference attribute uses the same name to reference the simple-page-master template:
**Note:** The value "A4" for 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.
YouTip