XSLT is an XSL Style Sheet
This can be a confusing concept.
XSLT is a piece of an XSL style sheet. XSL is written in XML format, so it begins with a declaration statement.
<?xml version="1.0"?>
<xsl: stylesheet version="1.0"
xmlns: xsl= http://http://www.w3.org/1999/XSL/Transform>
Create a Template Assignment
Templates establish the rules for the transformation of the data. You must direct the parser to a place in the XML code utilizing the 'match'attribute.
<xsl:template match="/">
This statement refers the template to the root of the XML document and says, 'Start looking there.'
Develop the Output Stream
Create a style for your data output written in an interpretable language, in this case HTML.
<html>
<body>
<h2>This is my XML data </h2>
<table>
<tr><td></td></tr>
<tr><td></td></tr>
</table>
</body>
</html>
This section instructs the parser to set up an HTML table in the output stream to display the XML data. Since XSL in written in XML format, you must close anything open.
</xsl:template>
</xsl:stylesheet>
The final XSLT coding looks like this:
<?xml version="1.0"?>
<xsl: stylesheet version="1.0"
xmlns: xsl= http://http://www.w3.org/1999/XSL/Transform>
<xsl:template match="/">
<html>
<body>
<h2>This is my XML data </h2>
<table>
<tr><td></td></tr>
<tr><td></td></tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
This is the fun part of developing XML code. Writing XML is dry storage. Writing XSLT allows you to decorate the space. XSLT is where you define colors and fonts that highlight the information carried by the XML document. The next article in this series will discuss the process that identifies what data to display where in XSLT.