Skip to main content

Search 400 pages — tools, formats, elements, namespaces, directory, comparisons, XPath, datatypes, glossary, parse errors, schema errors, use cases, guides, blog and product.

XML format

XSL-FO

The paged-media vocabulary produced by publishing transformations and consumed by formatters to create PDF or print output.

XSL-FO describes pages, regions, flows, blocks, inline content, tables, lists, markers, and pagination properties. A typical pipeline transforms semantic source XML into FO, then sends FO to a formatter that lays out PDF.

The W3C recommendation defines the vocabulary, but formatter support varies. Production stylesheets often target the documented subset and extensions of a specific engine.

Constraints that bite

  • fo:root contains layout-master-set before one or more page-sequence children.
  • Each page-sequence names a page master and supplies content through one or more flows.
  • Property inheritance and formatter-specific extensions can materially change layout.
  • Valid FO can still overflow or paginate badly, so rendered-output testing is essential.
Root element
<root>
Media type
application/xml
Extensions
.fo, .xml
Namespaces
  • http://www.w3.org/1999/XSL/Format
XMLDir label
xml

Specification: W3C XSL 1.1

A minimal valid document

Every example on this site is checked against the same parser the workspace uses, so what you see below is known to be well-formed.

xsl-fo.xml
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set><fo:simple-page-master master-name="page"><fo:region-body/></fo:simple-page-master></fo:layout-master-set>
  <fo:page-sequence master-reference="page"><fo:flow flow-name="xsl-region-body"><fo:block>Hello, XML.</fo:block></fo:flow></fo:page-sequence>
</fo:root>

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.