This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Table formatting challenge
David Carlisle wrote:
>
> Oliver,
>
> My code was shorter.
Extreme Programming has a rule that says that you should always write
the minimal code needed to solve a given problem and I think that you've
gone quite far in this direction, but you have exposed only an extract
of your transformation.
The full code would be at least:
============
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<table border="1">
<tr>
<td rowspan="2">A</td>
<td>B</td>
<td rowspan="2">C</td>
<td>D</td>
</tr>
<tr>
<td class="auto-generated"></td>
<td>E</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
============
And this can be simplified to:
============
<table xsl:version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" border="1">
<tr>
<td rowspan="2">A</td>
<td>B</td>
<td rowspan="2">C</td>
<td>D</td>
</tr>
<tr>
<td class="auto-generated"></td>
<td>E</td>
</tr>
</table>
============
Using a "Literal Result Element as Stylesheet" [1].
[1] http://www.w3.org/TR/xslt#result-element-stylesheet
Eric
>
> David
>
--
See you at XTech in San Diego.
http://conferences.oreillynet.com/cs/os2001/view/e_spkr/790
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
http://xsltunit.org http://4xt.org http://examplotron.org
------------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list