EnglishDeutschFrançais

Learn why the styling-based processing model of CSS is superior over the transformation-based processing model of XSL

Cascading Style Sheets (CSS) and Extensible Stylesheet Language (XSL) are two different style languages recommended by the World Wide Web Consortium (W3C). Although they use completely different processing models and syntax, they have one important similarity: both support a page layout model based on automatic pagination, and therefore can be used to print XML documents or Web content.

CSS as well as XSL are suitable for printing a great variety of business documents, book-style documents and other documents that include arbitrary quantity of flowing text which must be divided over multiple pages. However, they are less suitable for highly graphical and complex layout-driven documents (e.g. magazines, catalogs and newspapers), in which the multifaceted layout of each page usually requires manual intervention.

Both CSS and XSL can be used for various printing tasks. Pros and cons have been widely discussed. Which one should you use to print XML documents or Web content? According to W3C the rule can be summarized very succinctly:

 

Use CSS when you can, use XSL when you must!

 

In particular cases XSL might be necessary to achieve a very sophisticated layout, but for the majority of documents printed or streamed over the Web CSS is the superior choice. The benefits of CSS are obvious:

 

 

RTEmagicP_hook.gif

Very clean and understandable markup

 

RTEmagicP_hook.gif

Widely used and very popular on the Web

 

RTEmagicP_hook.gif

Much easier to use, easier to learn, thus easier to maintain

 

RTEmagicP_hook.gif

No need to master the complexities of XSL/XSL-FO syntax, programming and transformation

 

RTEmagicP_hook.gif

Multi-channel publishing (e.g. Web and Print) only requires the knowledge of one style language

 

RTEmagicP_hook.gif

Use simple declarative rules that specify the desired style and layout

 

RTEmagicP_hook.gif

Simple, styling-based approach that does not require advanced programming skills

 

RTEmagicP_hook.gif

Designers with no programming background can produce printed output quickly and efficiently

 

RTEmagicP_hook.gif

Reduce integration, deployment and maintenance costs

 

RTEmagicP_hook.gif

Increase the productivity of your designers

 

CSS's simplicity means it has its limitations. Some things you cannot do with CSS, or with CSS alone. For example: to calculate the total etc. within an invoice or billing statement. Then you need XSL, or at least XSLT, the transformation language/part of XSL. Therefore, PDFreactor comes with built-in support for XSLT processing that offers further flexibility and interoperability for those who need to include a XSLT style sheet on top.

 

Copyright © 2000-2009 RealObjects GmbH