This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl list breakdown?
- From: Mike Brown <mike at skew dot org>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sat, 31 Aug 2002 12:54:30 -0600 (MDT)
- Subject: Re: [xsl] xsl list breakdown?
- Reply-to: xsl-list at lists dot mulberrytech dot com
Michael wrote:
> How would I take a <list><item/><item/><item/></list> and say break it
> down into a table with 2 elements per row? Thanks.
Select the items that start each row.
Generate a row for each of those.
The first cell's content is based on the current item;
tje second cell's content is calculated relative to the current item.
If there's no content to fill in a cell, use ' '.
If you want to do colspan tricks instead, you just have to think
of a way to test that the current node is not the last in the row, and
that it doesn't have following siblings. Then you can generate a
colspan attribute with xsl:attribute, and give it a value that is
(max # of columns - 1) - position() ... at least, that's one way to
go about it.
Have you skimmed through the FAQ at http://www.dpawson.co.uk/ ?
Many examples there...
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list