XSLT Tutorial
eXtensible Stylesheet Language Transformation (XSLT)
XSL can be confusing because it can refer to several different things.
When people talk about XSL, they're usually referring to XSL Transformations (XSLT) and the
Path Language (XPath). XSL also includes a formatting language,
but the W3C hasn't approved the final recommendation for this part of XSL.
The formal recommendation for the XSLT transformation language was approved by the W3C on 26 November 1999.
The history of XSL
Cascading Style Sheets (CSS)
The origins of XSL are in Cascading Style Sheets (CSS), where a "stylesheet"
is used to add formatting to an HTML file. The syntax to use a stylesheet in XSLT is
similar to the syntax in CSS.
XSLT stylesheets have a very different function than CSS stylesheets, however.
CSS allows you to define the colours, backgrounds, and font-types for an HTML web page.
XSLT allows you to transform an XML file into an HTML file or another text-based format.
If you only need web page formatting, then you might still chose to use CSS because it's more widely implemented for
general HTML formatting and most people think it's easier to learn and use.
The development of XSLT progressed in several stages as people learned more about requirements for the language.
XML Query Language
Since XML allows people to define their own markup tags for documents,
transforming one XML document into another became a common requirement.
Also, since browsers can't display XML documents directly, it was necessary to
transform XML into HTML to allow browsers to display it on a web page.
To meet these needs, Microsoft, Texcel, and webMethods submitted a proposal in September 1998
to the W3C called the XML Query Language or XQL. Part of that proposal was the
use of the XSL pattern language as the basis for a general query mechanism
for XML documents.
eXtensible Stylesheet for Transformation
In May of 1999, the W3C decided to unify all the research that had been going
on in "a common core semantic model for querying" and one result was introduction of the
eXtensible Stylesheet Language for Transformation or XSLT.
XPath
During the development of XSLT, another member of the XML family,
known as XPointer was defined. XPointer takes the idea of anchor tags
to a new level. Both XPointer and XSLT needed a way
to point to various parts of a document. XSLT needed it to select the
part of the document that would be transformed and XPointer for
linking two documents. The solution was to provide a common syntax and semantics
that both XSLT and XPointer could use. This new subset was called XPath.
Although XPath is a subset of XSLT, it can also be used it on its own.
|