xsl-list
[Top] [All Lists]

XML List to Multi-column HTML transformation

2003-11-26 07:07:40

Hi all,

I've had a quick look in the archive and saw some items
close to this, I imagine it is a common question so
apologies if this is a pain.

Basically, is there a preferred method for transforming
a list of items (elements) in an XML source to a sorted,
multi-column HTML table.

e.g. 10 items in a list to a table of 3 cols. like this

                1       5       9
                2       6       10
                3       7
                4       8

I imagine I need to do something clever involving the use of 

        /MyElement[ position() mod X ] 

                                where X is the no. of columns I require.


I assume I would need to use a select such as this for each column
since the HTML table is created row-wise.

        <tr>
                <td>col1 select</td>    
                <td>col2 select</td>
                <td>col3 select</td>
        </tr>

I can think of ways to do most of the work but if someone has
done this elegantly I'd love to know how.

Many thanks,
Chris

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>