A comparison can be made between the relationship of CSS and HTML and the
relationship of XSLT and XML. XSLT is usually referred to as the
stylesheet language of XML, however XML and XSLT is more sophisticated
technologies than HTML and CSS.
XSLT is a high-level declarative language.
It is also a formatting and transforming language which describes exactly how XSLT behaves:
-
The related data is extracted from an XML source document and then it
is transformed into a new data structure which reflects the desired output. (The
results of this XSLT transformation is commonly called a stylesheet.) A parser
is used to convert the XML document into a tree structure which is composed of
various types of nodes. The transformation is accomplished with XSLT by using templates
pattern matching. Patterns are matched against the (source) tree
structure and templates are used to create a result tree.
-
Now new data structure is formatted, for example in HTML or as text, and
finally data is ready for display.
Note that XSLT only manipulates the source tree and that the original XML
document is left unchanged.
One of the important aspect of XSLT is that it allows you to perform extremely
complex manipulations on the selected tree nodes by affecting both content and
appearance. Indeed, the final output may bear absolutely no similarity to the
source document. This ability to manipulate the nodes is where XSLT leaves CSS
back.
|