The abbreviation XSLT means EXtensible Stylesheet Language Transformations. In other words, XSLT is transformation of XML document styled by XSL (EXtensible Stylesheet Language) into other format, like XHTML.
It might look confusingly at the first sight, but reality is much easier as it seems. Simply said, if you have some XML document, this can be styled by XSL (EXtensible Stylesheet Language) as well as transformed to (X)HTML.
A Word or Two About XSL
XSL is a language for expressing style sheets. An XSL style sheet is, like with CSS, a file that describes how to display an XML document of a given type. XSL shares the functionality and is compatible with CSS2 (although it uses a different syntax). It also adds:
Just remember: CSS = Style Sheets for HTML, XSL = Style Sheets for XML.
Styling by XSL requires a source XML documents, containing the information that the style sheet will display and the style sheet itself (XSL file) which describes how to display a document of a given type. More information about XSL and some explanatory examples can be found here.
Back to Transformation
XSLT is designed for use as part of XSL, which is a stylesheet language for XML. In addition to XSLT, XSL includes an XML vocabulary for specifying formatting. XSL specifies the styling of an XML document by using XSLT to describe how the document is transformed into another XML document that uses the formatting vocabulary.
XSLT is also designed to be used independently of XSL. However, XSLT is not intended as a completely general-purpose XML transformation language. Rather it is designed primarily for the kinds of transformations that are needed when XSLT is used as part of XSL.
A transformation expressed in XSLT describes rules for transforming a source tree into a result tree. The transformation is achieved by associating patterns with templates. A pattern is matched against elements in the source tree. A template is instantiated to create part of the result tree. The result tree is separate from the source tree. The structure of the result tree can be completely different from the structure of the source tree. In constructing the result tree, elements from the source tree can be filtered and reordered, and arbitrary structure can be added.
A transformation expressed in XSLT is called a stylesheet. This is because, in the case when XSLT is transforming into the XSL formatting vocabulary, the transformation functions as a stylesheet.
XSLT Example
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Title</th> <th>Artist</th> </tr> <xsl:for-each select="catalog/cd"> <tr> <td><xsl:value-of select="title"/></td> <td><xsl:value-of select="artist"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>
More information including Stylesheet Structure, Data Model, Expressions, Templates, Variables, Parameters or Functions can be found on W3C XSLT Recommendation.
Very nice XSL Transformation example with live Try Out is offered by W3C Schools here.