Skip to main content

Caspar Van der Linden's Library tagged XSLT   View Popular

17 Feb 09

HTML to Formatting Objects (FO) conversion guide

  • Need help converting HTML documents to PDF? This reference guide shows by example how to use XSLT templates to convert 45 commonly used HTML elements to formatting objects (from the XSL-FO vocabulary) for easy transformation to PDF using XSLT. The examples assume that you're using the Java-based XSLT processor Xalan and the Apache XML Project's FOP tool, but most of the methods would work just as well with other tools.



    We all design our HTML pages to look good on the screen, but printing those Web pages is usually an afterthought. To create printable versions of Web pages, the best approach is to use XSLT and XSL-FO to generate a PDF file. You can do the job with an open-source XSLT processor, the XSL Formatting Objects (XSL-FO) vocabulary, and a formatting-object engine. If you already know how to work with XSL-FO and XSLT, this guide provides a valuable resource: It goes through the most common HTML tags and defines how to convert each of them into formatting objects. (If you need background on using XSL-FO, try the developerWorks tutorials on the subject, easily found through Resources.)

    This guide includes dozens of examples that illustrate how to write XSLT style sheets to do the conversion from HTML element to the corresponding formatting object, the basic building block of documents rendered with XSL-FO.
14 Feb 09

RenderX - Support - XSL Formatting Objects Tutorial

  • This document gives a quick, learn-by-example introduction to XSL Formatting Objects. I don't discuss subtle details of implementation, but rather provide a series of examples of how to perform routine tasks with XEP — an XSL formatter developed by RenderX, Inc. It is not a manual of XSL FO (XSLFO) in general, and some examples given here may not work in other XSL FO (XSLFO) formatters, or give different results.

XSL-FO Examples

  • This section contains content relating to my XSL-FO book. Initially it is only the examples extracted from the book.
05 Feb 09

Internationalize your apps with XSLT

  • Today's reporting applications use XML extensively to format data, regardless of the different data sources. More specifically, Web-based reporting applications usually use XSL transformations to present this XML data to different clients. The standard flow for current reporting systems is more or less represented by this chain: legacy data source > XML > XSL transformation > Web browser. Note that you can perform the XSL transformation step either on the server side or the client side (the browser). The choice generally depends on nonfunctional requirements; for example, in a system with a high request rate, moving the XSL transformation to the client could result in performance and scalability benefits. The Web page coming from the XSL transformation must be internationalized. However, when the XSL transformation is performed on the client, the internationalization should be handled during the transformation itself. This means that the XSL transformation should manage the translation of the messages dynamically. In this article, we propose a general solution to address this issue.

XML.com: Using XSL Formatting Objects

  • Rather than explain XSL FO in its entirety, this article will give you enough information to use the major features of XSL FO. Our case study will be a short review handbook of Spanish that will be printed as an insert for a Spanish language learning CD-ROM. We'll use the Apache Software Foundation's FOP tool to convert the FO file to a PDF file.
1 - 5 of 5
Showing 20 items per page

Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »

Join Diigo