[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Table formatting challenge

Subject: Re: Table formatting challenge
From: Eric van der Vlist <vdv@xxxxxxxxxxxx>
Date: Thu, 12 Jul 2001 18:42:13 +0200
xsl table rowspan
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.