The Ground Cero Guide to XSL
Henrik Aasted Sorensen
<< Short introduction to XMLXSLT >>
3. Introducing the Extensible Stylesheet Language (XSL)
XSL is probably the first XML-language to make it out of the computer science laboratories to the general public. Several wide-spread browsers already support it. Expect more exciting technologies to emerge in the coming years.
XSL is capable of transforming documents from one XML-language to another using an XSL-processor. The transformation is described in an XSL-file. By far, the most widespread use of this today is the transformation into XHTML-documents, which is the XML-version of HTML. Using the address-book example from before, this would allow us to define an XSL-document for making a web-version of the addressbook. The advantage of doing it this way, is the absolute separation of content and layout. In the addressbook-XML-file we keep only the data, while all information on how to show it is in another file. This also adds the possibility of using more than one XSL-sheet and thus rendering the addressbook in a different way.
Although this tutorial will focus on transforming XML-documents into XHTML, it's important to emphasize that XSL can be used for transforming between any two XML-languages.
XSL is actually made up of two languages: XSLT and XPath. XSLT is used for the transformation itself, while XPath is used for navigating the XML-tree.
I'll start with introducing XSLT and postpone XPath a bit.
<< Short introduction to XMLXSLT >>
Index