[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML->HTML tables with blank cells ...
Hi Carmen, Please try this stylesheet: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes" /> <xsl:template match="/worksheet"> <html> <head> <title/> </head> <body> <table> <tr> <th><xsl:value-of select="row[@number = '0']/col[@number = '0']" /></th> <th><xsl:value-of select="row[@number = '0']/col[@number = '1']" /></th> <th><xsl:value-of select="row[@number = '0']/col[@number = '2']" /></th> <th><xsl:value-of select="row[@number = '0']/col[@number = '3']" /></th> <th><xsl:value-of select="row[@number = '0']/col[@number = '4']" /></th> </tr> <xsl:for-each select="row[not(@number = '0')]"> <tr> <td><xsl:value-of select="col[@number = '0']" /></td> <td><xsl:value-of select="col[@number = '1']" /></td> <td><xsl:value-of select="col[@number = '2']" /></td> <td><xsl:value-of select="col[@number = '3']" /></td> <td><xsl:value-of select="col[@number = '4']" /></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> The output produced is: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <table> <tr> <th>Name</th> <th>Grade</th> <th>Phone</th> <th>City</th> <th>State</th> </tr> <tr> <td>Anna</td> <td>3</td> <td>555-5555</td> <td>Livermore</td> <td>CA</td> </tr> <tr> <td>David</td> <td>4</td> <td></td> <td>Livermore</td> <td>CA</td> </tr> <tr> <td>Jane</td> <td>5</td> <td></td> <td></td> <td></td> </tr> </table> </body> </html> Regards, Mukul On 7/11/06, Carmen Pancerella <carmen@xxxxxxxxxxxxx> wrote: Hello.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|