Microsoft Word meets XSL-FO

In MSDN there is an article about Transforming Word Documents into the XSL-FO Format. The article introduces WordprocessingML and XSL-FO vocabularies and shows how to transform Word documents to into XSL-FO.

WordprocessingML
Microsoft made customizing Microsoft Office Word documents much easier and simpler when it introduced a new XML file format called WordprocessingML with Microsoft Office Word 2003. WordprocessingML is an XML representation, or schema, of the Word document file format. The flexibility of XML allows you to export data seamlessly from a Word document using standard XML representations of objects in a document. The new WordprocessingML schema also provides easy access to contents of Word documents without programming efforts or knowledge of the internal format of a Word document.

XSL Formatting Objects
In 2001 the W3C endorsed an XML formatting language known as XSL Formatting Objects (XSL-FO). XSL-FO is synonymous with eXtensible Stylesheet Language (XSL), one of three recommendations by the W3C’s XSL working group. The three recommendations are 1. XSL Transformations (XSLT), for transforming XML files 2.XML Path Language (XPath), for defining parts of an XML document 3. Extensible Stylesheet Language (XSL), or XSL-FO, for XML formatting information

XSL-FO is an intermediate form that results from applying an XSLT style sheet to an XML structured document. The XML-FO form describes how pages appear when presented to a reader, such as a Web browser. Currently, there are no readers that directly interpret an XSL-FO document. To interpret them, you must run them through a formatter, along with other data, such as graphics and font metrics, to create a final displayable or printable file. Possible formats for the resulting file include Adobe’s Portable Document Format (PDF) and Hypertext Markup Language (HTML).

When compared to Cascading Style Sheets (CSS), XSL-FO provides a more sophisticated visual layout model. You can use CSS to apply specific style elements to an XML or HTML document. By contrast, XSL-FO is a language for describing a complete document. It includes everything needed to paginate and format a document. Some of the formatting supported by XSL-FO, but not by CSS, includes right-to-left and top-to-bottom text, footnotes, margin notes, page numbers in cross-references, and more. Note that while CSS is primarily intended for use on the Web, XSL-FO is designed for broader use. As an example, you could use an XSL-FO document to lay out an XML document as a printed book. You could write a completely separate XSL-FO document to transform the same XML document into HTML.

Maybe this will boost XSL-FO as a technology on .NET world forward. It has been a shame that XSL-FO hasn’t got popularity even though it’s a very