This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Table formatting challenge
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Table formatting challenge
- From: Norman Walsh <ndw at nwalsh dot com>
- Date: 15 Jul 2001 16:04:15 -0400
- References: <200107121538.RAA32115@mail.informatik.hu-berlin.de>
- Reply-To: xsl-list at lists dot mulberrytech dot com
/ Oliver Becker <obecker@informatik.hu-berlin.de> was heard to say:
| > I'm hoping I've overlooked something clever and elegant.
|
| Evaluate it yourself ;-)
| Tested with Saxon and Xalan, doesn't need extensions.
| I hope my comments are reasonable useful.
Yes, you're pursuing the same line of attack that I did. The problem,
however, can get a good deal more challenging :-). Here are a few more
examples (that thwart the code you presented).
The table:
+........+........+........+........+
| A | B | C | D |
+........+........+ + +
| E | F | | |
+ +........+ + +
| | G | | |
+ +........+........+........+
| | H | | I |
+........+........+........+........+
The XML:
<informaltable>
<tgroup cols="4">
<colspec colname="c4b" colnum="4"/>
<tbody>
<row>
<entry>A</entry>
<entry>B</entry>
<entry morerows="2">C</entry>
<entry morerows="2">D</entry>
</row>
<row>
<entry morerows="2">E</entry>
<entry>F</entry>
</row>
<row>
<entry>G</entry>
</row>
<row>
<entry>H</entry>
<entry namest="c4b">I</entry>
</row>
</tbody>
</tgroup>
</informaltable>
The HTML:
<table border="1">
<tr>
<td>A</td>
<td>B</td>
<td rowspan="3">C</td>
<td rowspan="3">D</td>
</tr>
<tr>
<td rowspan="3">E</td>
<td>F</td>
</tr>
<tr>
<td>G</td>
</tr>
<tr>
<td>H</td>
<td class="auto-generated"></td>
<td>I</td>
</tr>
</table>
The table:
+........+........+........+........+
| A | B | C | D |
+........+ +........+ +
| E | | F | |
+ + +........+........+
| | | | G |
+........+........+........+........+
| H | | I | J |
+........+........+........+........+
The XML:
<informaltable>
<tgroup cols="4">
<colspec colname="c3c" colnum="3"/>
<colspec colname="c4c" colnum="4"/>
<tbody>
<row>
<entry>A</entry>
<entry morerows="2">B</entry>
<entry>C</entry>
<entry morerows="1">D</entry>
</row>
<row>
<entry morerows="1">E</entry>
<entry>F</entry>
</row>
<row>
<entry namest="c4c">G</entry>
</row>
<row>
<entry>H</entry>
<entry namest="c3c">I</entry>
<entry>J</entry>
</row>
</tbody>
</tgroup>
</informaltable>
The HTML:
<table border="1">
<tr>
<td>A</td>
<td rowspan="3">B</td>
<td>C</td>
<td rowspan="2">D</td>
</tr>
<tr>
<td rowspan="2">E</td>
<td>F</td>
</tr>
<tr>
<td class="auto-generated"></td>
<td>G</td>
</tr>
<tr>
<td>H</td>
<td class="auto-generated"></td>
<td>I</td>
<td>J</td>
</tr>
</table>
The table:
+........+........+........+........+
| A | | | |
+ +........+........+........+
| | B | | C |
+ +........+........+........+
| | | D | |
+........+........+ +........+
| | | | E |
+........+........+........+........+
The XML:
<informaltable>
<tgroup cols="4">
<colspec colname="c3d" colnum="3"/>
<colspec colname="c4d" colnum="4"/>
<tbody>
<row>
<entry morerows="2">A</entry>
</row>
<row>
<entry>B</entry>
<entry namest="c4d">C</entry>
</row>
<row>
<entry namest="c3d" morerows="1">D</entry>
</row>
<row>
<entry namest="c4d">E</entry>
</row>
</tbody>
</tgroup>
</informaltable>
The HTML:
<table border="1">
<tr>
<td rowspan="3">A</td>
<td class="auto-generated"></td>
<td class="auto-generated"></td>
<td class="auto-generated"></td>
</tr>
<tr>
<td>B</td>
<td class="auto-generated"></td>
<td>C</td>
</tr>
<tr>
<td class="auto-generated"></td>
<td rowspan="2">D</td>
<td class="auto-generated"></td>
</tr>
<tr>
<td class="auto-generated"></td>
<td class="auto-generated"></td>
<td>E</td>
</tr>
</table>
Be seeing you,
norm
--
Norman.Walsh@Sun.COM | The laws of conscience, which we pretend to be
XML Standards Engineer | derived from nature, proceed from
Technology Dev. Group | custom.--Montaigne
Sun Microsystems, Inc. |
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list