I don't know what is wrong with my code. I need to transform a scx file from openoffice (spreadsheet) to a html file.
this is my original xml (simplified)
Code:
<office:body>
<table:table table:name="kladblad1" table:style-name="ta1">
<table:table-column table:style-name="co1" table:number-columns-repeated="5" table:default-cell-style-name="Default"/>
<table:table-row table:style-name="ro1">
<table:table-cell table:style-name="ce1">
<text:p>Artist</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1">
<text:p>Album</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1">
<text:p>Year</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1">
<text:p>Genre</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce1">
<text:p>Rating</text:p>
</table:table-cell>
</table:table-row>
<table:table-row table:style-name="ro1">
<table:table-cell>
<text:p>Underworld</text:p>
</table:table-cell>
<table:table-cell>
<text:p>Beaucoup fish</text:p>
</table:table-cell>
<table:table-cell table:value-type="float" table:value="2002">
<text:p>2002</text:p>
</table:table-cell>
<table:table-cell>
<text:p>Techno</text:p>
</table:table-cell>
<table:table-cell>
<text:p>***</text:p>
</table:table-cell>
</table:table-row>
<table:table-row table:style-name="ro1">
<table:table-cell>
<text:p>HIM</text:p>
</table:table-cell>
<table:table-cell>
<text:p>Love metal</text:p>
</table:table-cell>
<table:table-cell table:value-type="float" table:value="2003">
<text:p>2003</text:p>
</table:table-cell>
<table:table-cell>
<text:p>Rock</text:p>
</table:table-cell>
<table:table-cell>
<text:p>****</text:p>
</table:table-cell>
</table:table-row>
<table:table-row table:style-name="ro1">
<table:table-cell>
<text:p>HIM</text:p>
</table:table-cell>
<table:table-cell>
<text:p>Dark light</text:p>
</table:table-cell>
<table:table-cell table:value-type="float" table:value="2005">
<text:p>2005</text:p>
</table:table-cell>
<table:table-cell>
<text:p>Rock</text:p>
</table:table-cell>
<table:table-cell>
<text:p>******</text:p>
</table:table-cell>
</table:table-row>
<table:table-row table:style-name="ro1">
<table:table-cell>
<text:p>Ill Nino</text:p>
</table:table-cell>
<table:table-cell>
<text:p>Unframed</text:p>
</table:table-cell>
<table:table-cell table:value-type="float" table:value="2001">
<text:p>2001</text:p>
</table:table-cell>
<table:table-cell>
<text:p>Heavy rock</text:p>
</table:table-cell>
<table:table-cell>
<text:p>***</text:p>
</table:table-cell>
</table:table-row>
</table:table>
<table:table table:name="Werkblad2" table:style-name="ta1">
<table:table-column table:style-name="co1" table:default-cell-style-name="Default"/>
<table:table-row table:style-name="ro1">
<table:table-cell/></table:table-row>
</table:table>
<table:table table:name="Werkblad3" table:style-name="ta1">
<table:table-column table:style-name="co1" table:default-cell-style-name="Default"/>
<table:table-row table:style-name="ro1">
<table:table-cell/>
</table:table-row>
</table:table>
</office:body>
and this is my xsl to transform it (also not complete but only the relevant code)
Code:
<xsl:template match="office:body">
<html>
<head>
<title>tester HTML transformer</title>
</head>
<body>
<b>transformer scx to html</b><br/><br/>
<xsl:for-each select="table:table">
<xsl:value-of select="@table:name"/>#160;style:<xsl:value-of select="@table:style-name"/><br/>
</xsl:for-each>
<xsl:apply-templates select="table:table" />
</body>
</html>
</xsl:template>
<xsl:template match="table:table">
<table border="1" cellpadding="1" cellspacing="1">
<tbody>
<xsl:apply-templates select="table:table-row"/>
</tbody>
</table>
</xsl:template>
<xsl:template match="table:table-row">
<td>
<xsl:for-each select="table:table-cell">
<xsl:apply-templates select="table:table-cell"/>
</xsl:for-each>
</td>
</xsl:template>
<xsl:template match="table:table-cell">
<tr>
<xsl:apply-templates select="text:p"/>
</tr>
</xsl:template>
<xsl:template match="text:p">
<xsl:value-of select="."/>
</xsl:template>
and my html file only sums up the 3 table:tables, and gives 1 biggercell, then 2 small cells beneath it
why doesnt it output all the textdata in cells ?
here is the code of it
Code:
<html><head><meta http-equiv="Content-Type" content="; charset=UTF-8"><title>tester HTML transformer</title></head><body><b>transformer scx to html</b><br><br>kladblad1Ã style:ta1<br>Werkblad2Ã style:ta1<br>Werkblad3Ã style:ta1<br><table border="1" cellpadding="1" cellspacing="1"><tbody><td /><td /><td /><td /><td /></tbody></table><table border="1" cellpadding="1" cellspacing="1"><tbody><td /></tbody></table><table border="1" cellpadding="1" cellspacing="1"><tbody><td /></tbody></table></body></html>