18-07-2012, 12:42 PM
Extensible Stylesheet Language (XSL)
xsl.ppt (Size: 2.13 MB / Downloads: 30)
XSLT
XSLT is a language for transforming XML documents into other XML documents
For example, XHTML, RSS, KML, GML, MathML, WML
Can also transform XML to text documents, e.g., SQL programs
An XSLT program is itself an XML document (called an XSL stylesheet) that describes the transformation process for input documents
Applying XSL Stylesheets to XML
There are several ways of applying an XSL stylesheet to an XML document:
Directly applying an XSLT processor to the XML document and the XSL stylesheet
Calling an XSLT processor from within a program
Adding to the XML document a link to the XSL stylesheet and letting the browser do the transformation
The resulting XHTML document is shown instead of the original XML
How Does XSLT Work?
An XSL stylesheet is a collection of templates that are applied to source nodes (i.e., nodes of the given XML)
Each template has a match attribute that specifies to which source nodes the template can be applied
Each source node has at a template that matches it
The current source node is processed by applying a template that matches this node
When processing a node, it is possible (but not necessary) to recursively process other nodes, e.g., the children of the processed node
The XSLT processor processes the document root (/)