View Single Post
  #8 (permalink)  
Old March 9th, 2005, 06:11 AM
pgtips pgtips is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Apologies, I didn't really look at your stylesheet past noticing that you didn't have a top-level template. I think you need to do a bit more reading about the basics, especially the relationship between xsl:template and xsl:aaply-templates.

Anyway, is this what you want?
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <xsl:template match="/">
        <html>
            <body>
                <table width="80%" border="1">
                    <xsl:apply-templates/>
                </table>
            </body>
        </html>
    </xsl:template>
    <xsl:template match="mag">
        <tr bgcolor="lightgrey">
            <xsl:apply-templates/>
        </tr>
    </xsl:template>
    <xsl:template match="mag/*">
        <td>
            <xsl:value-of select="name()"/>
        </td>
    </xsl:template>
</xsl:transform>
Reply With Quote