XSL(Extensible Stylesheet language) is a language for expressing stylesheets. Let’s find out what XSL and XSLT are.
XSL was originally chosen as the title of the single specification. But things became more complicated during the development, and the final specification was divided into three separate parts :
- XSL Transformations (XSLT) : a language for transforming XML documents
- XML Path Language (XPath) : an expression language used by XSLT to access or refer to parts of an XML document
- XSL Formatting Objects(XSL-FO) : an XML vocabulary for specifying formatting semantics
2. XSL Recommendation
- XSL 1.0: W3C Recommendation, 15 October 2001
- XSLT 1.0: W3C Recommendation, 16 November 1999
- XSLT 2.0: W3C Recommendation, 23 January 2007
- XPath 1.0: W3C Recommendation, 16 November 1999
- XPath 2.0: W3C Recommendation, 23 January 2007
3. Software Support
A transformation in the XSLT language is expressed as a well-formed XML document, which may include both elements that are defined by XSLT and elements that are not defined by XSLT. XSLT-defined elements are distinguished by belonging to a specific XML namespace(XSLT namespace).
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.
5. XSLT Features
A transformation expressed in XSLT is called a stylesheet. A stylesheet contains a set of template rules.
A template rule has two parts:
- pattern : matched against nodes in the source tree
- template : instantiated to form part of the result tree.
XSLT makes use of the expression language defined by XPath for selecting elements for processing, for conditional processing and for generating text.
6. XSLT Processors/Applications
The XSLT processor gathers materials from the source tree, and creates the result tree. An XSLT processor may be embedded within an XSLT application that reads the XML file and create an output file.