W3C home > Mailing lists > Public > www-xsl-fo@w3.org > December 2002

Re: Implementing a multi-column list

From: David Carlisle <davidc@nag.co.uk>
Date: Tue, 3 Dec 2002 16:43:44 GMT
Message-Id: <200212031643.QAA11675@penguin.nag.co.uk>
To: Cindy.Hunt@sas.com
CC: www-xsl-fo@w3.org



If your list will always fit on one page it sounds like you can just
make a table.

I think your input is something like
<list cols="3">
  <item>111</item>
  <item>111</item>
  <item>111</item>
</list>


> I need to count the number of items in the list and divide it by the
> number of columns they specified

<xsl:variable name="n" select="ceiling(count(item) div @cols"/>



<xsl:for-each select="item[position() &lt;= $n]">
<row>
<xsl:for-each select=".|following-sibling::item[position() mod $n = 0]">
 <cell>
   <xsl:value-of select="."/>
 </cell>
</xsl:for-each>
</row>
</xsl:for-each>


(with suitable FO replacements for <row and <cell

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
Received on Tuesday, 3 December 2002 11:44:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:10 GMT