Converting XML to XSL-FO
In this section, we will convert the example XML document (catalog.xml
) to an XSL-FO document. An XSL-FO document includes formatting information about the data to be presented. It includes the layout, fonts, and tables in the document. An XSL-FO document is created in the fo
prefix namespace using the namespace declaration xmlns:fo=http://www.w3.org/1999/XSL/Format
. The root element of the XSL-FO document is fo:root
. The XSL-FO document elements are based on the fo.dtd
DTD, which may be downloaded from http://www.syntext.com/products/dtd2xs/doc/fo.dtd. Some of the commonly used elements in an XSL-FO document are listed here:
Element |
Attributes |
Sub-Elements |
Description |
---|---|---|---|
|
xmlns:fo |
|
Root element |
|
- |
| |
|
margin-right, margin-left, margin-bottom, margin-top, page-width, page-height, master-name |
|
Page layout |
|