The Foundation: XML, XSL, X-Link (1/4) - exploring XML | WebReference

The Foundation: XML, XSL, X-Link (1/4) - exploring XML

The Foundation: XML, XSL, X-Link

XML on its own is not terribly exciting. It is simply a way of expressing data in a format readable by both man and machine. But it does show its impressive power when one looks at the long list of vocabularies that have been defined in XML. Coming to think of it, this is true for HTML in a similar fashion: Its most impressive aspect is the existence of millions of documents that make up the Web as we know it, covering many topics of human life, and spanning almost every part of the globe.

In this section of the column we will examine the most important XML vocabularies, decyphering all the TLAs (Three Letter Acronyms) along the way, and discuss their applications and implications. Let's start with the foundation layed by the World-Wide Web Committee (W3C): Styles, links and documents.

Styles, links and documents

When the W3C started to define XML as an improved way of expressing and transmitting information, it was mainly concerned with the functions that make up a Web browser or other document reader today:

So the first two applications for XML under consideration were targeted at style sheets and document links.

Extensible stylesheet language (XSL)

Did you ever wonder why Cascading Style Sheets (CSS) have a completely different syntax from HTML? I did, and the folks at W3C now did, too. Not only is it inconvenient for users to master two completely different formats, it is also introducing unnecessary redundancy in software: Your favourite browser has an HTML parser and a CSS parser built in separately. If they shared the same syntax the browser could use the same basic parser code, and we authors and developers could use the same basic editing tools for both content and style. This is why XSL is cleverly defined in XML, and every generic XML tool can be used to view, edit, and process it. You can even use an XSL stylesheet to transform one XSL stylesheet into another. If you can actually think of a good reason why somebody would want that please drop me a line, but using a minimal set of technologies is always a good thing, because there is less to learn and more to reuse.

If you would like to read up on XSL basics, my first column provides an introduction and some examples to get you started.

Transformations vs Flow Objects

The XSL standardization started out with the ambitious goal to standardize styling and rendering of content. The process slowed down because of the complex requirements that print level quality should be achievable with XSL, as opposed to the comparatively simple on-screen positioning of CSS. As a consequence the standard was broken into two parts, XSL transformations (XSL-T) for transforming one document to another, and XSL flow objects (XSL-FO) for precisely specifying layout. XSL-T is now in widespread use for transforming XML documents into other representations such as XML for a different DTD, HTML, or low precision PDF. XSL-FO is still in the making, but several projects experiment with it for producing higher precision PDF and the like.

XSL-T is a combination of three components:

  1. The pattern matcher
  2. The rules engine
  3. The template processor

Produced by Michael Claßen
All Rights Reserved. Legal Notices.

Created: Dec. 20, 1999
Revised: Dec. 21, 1999