The components of the XSL language |
The full XSL language logically consists of three component languages which are described in three W3C (World Wide Web Consortium) Recommendations:
XPath: XML Path Language--a language for referencing specific parts of an XML document
XSLT: XSL Transformations--a language for describing how to transform one XML document (represented as a tree) into another
XSL: Extensible Stylesheet Language--XSLT plus a description of a set of Formatting Objects and Formatting Properties
The result tree's structure is that of an XML document, and its objects correspond to elements with attributes
The result tree's structure and "tag set" can match that of any XML document or doctype. In particular, the result tree could be:
result tree is easily written out as an HTML document
result tree is easily written out as an XML document in this other doctype (for some further application-specific processing)
result tree's structure (and element and attribute names) matches the set of formatting objects and formatting properties defined by the (non-transformation) part of XSL
Serialization of the result tree is not necessary for further processing of the result tree.
An XSL stylesheetAn XSL stylesheet basically consists of a set of templates
Each template "matches" some set of elements in the source tree and then describes the contribution that the matched element makes to the result tree
Generally, elements in a stylesheet in the "xsl" namespace are part of the XSLT language, and non-xsl elements within a template are what get put into the result tree
HTML vs. XSL Formatting ObjectsTransformation is independent of the target result type
Most people are more familiar with HTML so many of the examples in this tutorial use HTML
The XSL implementation in IE5 is incomplete. The examples in this tutorial will not work in IE5
The techniques apply equally well to XSL Formatting Objects or other tag sets
XSLT is a tree-to-tree transformation process
Serialization may vary depending on the selected output method
There is a distinction between HTML element names and HTML
XSLT Stylesheets are XML documents; namespaces (http://www.w3.org/TR/REC-xml-names) are used to identify semantically significant elements.
Most stylesheets are stand-alone documents rooted at <xsl:stylesheet> or <xsl:transform>. It is possible to have "single template" stylesheet/documents.
<xsl:stylesheet> and <xsl:transform> are completely synonymous.
Note that it is the mapping from namespace abbreviation to URI that is important, not the literal namespace abbreviation "xsl:" that is used most commonly.