XSL-FO began back in the late 1990s when the W3C set out to create a page description language that could be used to format and display XML data. The idea behind this page description language is that it would allow XML developers to completely separate XML content from the details of how that content is rendered on a page for display. To facilitate the translation of raw XML data into a styled format, the W3C also began creating a transformation language. This transformation language became XSLT, while the descriptive formatting language became XSL-FO. However, XSLT caught on much quicker, and ultimately became the standard stylesheet mechanism for XML document processing and transformation. Many web developers now regularly use XSLT in combination with CSS to transform and style XML documents.
This scenario has fallen short of the W3C's initial goal of having XSLT and XSL-FO be the one-two transformation/style punch. The reality is that CSS was already widely supported and understood, so it only made sense for it to represent the first wave of style XML documents. XSL-FO offers everything CSS has to offer and much more, so we may eventually see XSL-FO begin to make its way into web pages at some point in the future. For now, however, XSL-FO is relegated to more of a specialized role in helping to layout and format very specific types of print documents.
Comparisons are often made between XSL-FO and CSS, and for the most part they are valid. One critical distinction between the two technologies is that CSS styles are always attached to an existing document tree, whereas XSL-FO establishes its own document structure. In other words, you apply CSS styles to XML data, whereas XSL-FO represents a complete merger of data and styles. In practice, XML data is typically still maintained separately from its XSLT stylesheet, which is then used to combine the data and XSL-FO styles into a complete XSL-FO document.
The good news is that aside from web browsers, there is actually a great deal of support for XSL-FO in back-end XML development tools. You learn about one such tool later in this lesson when you find out how to convert XSL-FO documents to PDF documents.