Subject: Should be simple -- XSLT on XHTML document From: Kynn Bartlett <kynn@xxxxxxxxxxxx> Date: Sun, 13 Aug 2000 16:02:20 -0700 |
I'm trying to apply an XSLT stylesheet to an XHTML document to produce a new XHTML document with style="..." tags added. For some reason it's not working.
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>A Simple Data Table</title> </head> <body> <table> <tr> <th>Dog Name</th> <th>Sex</th> <th>Age</th> </tr> <tr> <td>Angie</td> <td>female</td> <td>10</td> </tr> <tr> <td>Xena</td> <td>female</td> <td>2</td> </tr> <tr> <td>Kim</td> <td>male</td> <td>10</td> </tr> </table> </body> </html>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/1999/xhtml">
<xsl:strip-space elements="*"/> <xsl:output indent="yes"/>
<xsl:template match="/"> <html> <head> <title>Bartlett Dogs</title> </head> <body> <h1 style="font-family: Arial, Geneva, Helvetica, sans-serif">Bartlet t Dogs</h1> <xsl:apply-templates select="html/body/*" /> </body> </html> </xsl:template>
<xsl:template match="table"> <table border="0" width="585" style="background-color: green;" cellspacin g="4"> <xsl:apply-templates /> </table> </xsl:template>
<xsl:template match="tr"> <tr> <xsl:apply-templates /> </tr> </xsl:template>
<xsl:template match="th"> <th align="left" style="background-color: white; font-weight: bold; font- family: Arial, Geneva, Helvetica, sans-serif"> <xsl:apply-templates /> </th> </xsl:template>
<xsl:template match="td"> <td align="left" style="background-color: yellow; font-weight: bold; font -family: Arial, Geneva, Helvetica, sans-serif"> <xsl:apply-templates /> </td> </xsl:template>
<?xml version="1.0" encoding="utf-8" ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Bartlett Dogs</title> </head> <body> <h1 style="font-family: Arial, Geneva, Helvetica, sans-serif">Bartlett Dogs</h1> </body> </html>
I'm sure it must be something painfully obvious, but I can't see it, and neither can one of my friends. What glaringly obvious thing have I overlooked here?
-- -- Kynn Bartlett <kynn@xxxxxxxxxxxx> http://www.kynn.com/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Saxon and jvm, Joshua Allen | Thread | Re: Should be simple -- XSLT on XHT, Mike Brown |
RE: Saxon and jvm, Joshua Allen | Date | Re: Should be simple -- XSLT on XHT, Mike Brown |
Month |