/ Published in: XML
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" /> <xsl:variable name="title" select="/Workbook/Worksheet/@Name"/> <xsl:template match="/"> <html><head><title>Leisure Timetable</title></head> <body> <h1><xsl:value-of select="$title"/></h1> <xsl:apply-templates select="Workbook/Worksheet"/> </body> </html> </xsl:template> <xsl:template match="Worksheet"> <xsl:apply-templates select="Table"/> </xsl:template> <xsl:template match="Table"> <table border="1"> <xsl:apply-templates select="Row"/> </table> </xsl:template> <xsl:template match="Row"> <tr> <xsl:for-each select="Cell"> <td><xsl:value-of select="." /></td> </xsl:for-each> </tr> </xsl:template> </xsl:stylesheet>