10. Executive summary
-
1. Create a XSLT stylesheet file: xxx.xsl
-
2. Copy/paste the XSLT header and root element below (decide encoding as you like)
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</xsl:stylesheet>
-
Write a rule that deals with your XML root element
-
This rule must produce the root, head and body of the HTML (copy/paste this too)
<xsl:template match="page">
<html>
<head> <title> <xsl:value-of select="title"/>
</title> </head>
<body bgcolor="#ffffff">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
-
4. Write rules for
each
(!!) of your XML elements,
-
for each insert some HTML, sometimes some text, or sometimes nothing
-
make sure to place a <xsl:apply-templates> inside each rule (usually between some HTML) ... unless you wish to censor contents.
-
5. Associate this stylesheet with your XML file using:
-
<?xml-stylesheet href="xxx.xsl" type="text/xsl"?>
-- TIE