This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: two columns in a table from one
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] two columns in a table from one
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Tue, 31 Jul 2001 10:29:54 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
You'll find the solution in the FAQ at
http://www.dpawson.co.uk/xsl/sect2/N7450.html#d204e66
(though admittedly it isn't easy to find: DaveP, can you fix this?)
<xsl:for-each select="item[position() mod 5 = 1]">
<tr>
<xsl:apply-templates
select=".|following-sibling::item[position() < 5]"/>
</tr>
<xsl:for-each>
Mike Kay
Software AG
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of
> Matthew Smith
> Sent: 31 July 2001 01:30
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] two columns in a table from one
>
>
> How can I turn a list of like named nodes into a two column
> html table with
> xslt?
> Here's some sample xml and desired html:
>
> <!-- XML -->
> <people>
> <person>John</person>
> <person>Suzy</person>
> <person>Tod</person>
> <person>Mark</person>
> <person>Matt</person>
> </people>
>
> <!-- HTML -->
> <table>
> <tr><td>John</td><td>Suzy</td></tr>
> <tr><td>Tod</td><td>Mark</td></tr>
> <tr><td>Matt</td><td></td></tr>
> </table>
>
> The empty td element in the final row of odd numbered lists isn't
> imperative, but would be nice.
> Thanks, Matt
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list