XSL or extensible stylesheet language, is a language written to help format XML documents. To understand what this means, we need to take a look at XML and compare it to HTML.
When you create an HTML document, you use tags such as <table> and <strong>. Then, when that page is viewed in a browser, the browser knows how to display the content in those elements. But when you write an XML document, the browser doesn't necessarily know how to display those same elements. The <table> element might be defining an HTML table, or it might be defining a coffee table, the browser displaying the HTML has no idea how to display the elements.
XSL Provides Formatting for XML
XSL is the intermediary between the XML elements and the browser. This is the language that tells the browser how to display the various elements, such as <table>. There are three parts to XSL:
This language takes existing XML documents and transforms them into other XML documents. It allows an XML author to write content only once and put it in many different formats.
The XPath language defines parts of an XML document. This allows XML authors to link to very specific locations within an XML document.
- XSL Formatting Objects
Formatting objects are part of the XSL specification, and they define the formatting for various objects or portions of the XML document.
When people start learning XSL they often move straight from XML to XSLT and avoid the formatting elements completely. But in some ways, this was why XSL was written in the first place. The XSL-FO language (a subset of XSL) is the language that defines the presentation of an XML document.
XSLT is what most people start to learn when learning XSL. This is the quasi-scripting language of XSL. It allows you to convert one XML document into another without a lot of trouble. This can be very useful if your site needs to be available in many different formats. Using an XSLT stylesheet, you can convert your XHTML to WML or your SMIL to XHTML.
XPath is the lost step-child of XSL. It is often forgotten, especially in the excitement of converting all your XHTML documents into something else. But it allows you to reference and use nearly any part of an XML document, not just those parts that you've surrounded with an <a name> element.