Stylesheet languages for visualisation

As said on the W3C-pages: By attaching style sheets to structured documents on the Web (e.g. HTML), authors and readers can influence the presentation of documents without sacrificing device-independence or adding new HTML tags. Separation of content and presentation, one of the holy grails of the Internet. In effect, you want one file containing information expressed with meaningful tags and another one containing instruction on how to present that tagged information to the user.

Difference Cascading Style Sheets (CSS) and eXtensible Stylesheet Language/Formatting Objects (XSL/FO)

CSS means Cascading Style Sheets (you can lay some styles on top of each other, so to say). XSL/FO means eXtensible Style Sheets / Formatting Objects.

Both CSS and XSL/FO are formatting stylesheets in their own right. Both use the same underlying formatting model. Both have knowledge about formatting like font-size and margin-left, but the syntax they use to access this formatting is different.

The biggest difference is that XSL/FO is the formatting part of XSL. The other half of XSL is XSL/T, the part that is capable of changing the information, rearranging it, extracting parts, adding titles, etc. Both can be used independently (and especially XSL/T mostly is), but using the same language and way of expressing for both the transformation and the formatting is an advantage.

Usage of stylesheets

The stylesheet controls the way the information is displayed to the user, either in print or on screen. Tags are matched against rules and the relevant formatting information is applied. In XSL/FO, making <scream> into bold text is done with the following rule:

Example A-7. XSL/FO example

	      <xsl:template match="scream">
	      <fo:inline-sequence font-weight="bold">

The same is done as follows in CSS:

Example A-8. CSS example

		scream { display: inline; font-weight: bold; }

Use for ceXML

Both technologies do not offer anything spectacular to ceXML, but stylesheets are simply needed to present information to the user in a well-formatted way. With plain HTML a lot can be solved, but when one uses XML, information has to be added indicating how it should be displayed, since no browser can possibly know how to display a <contractfooter>-tag.