|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Splitting data into smaller groups for HTML output
Mike,
The one thing you don't say is by what rule you would like the splitting to occur (you only say "into two or more groups"). If you wanted to split into exactly two groups, you could do: <xsl:template match="sources">
<div>
<xsl:apply-templates
select="source[position() <= (last() div 2)"/>
</div>
<div>
<xsl:apply-templates
select="source[position() > (last() div 2)"/>
</div>
</xsl:template>Notice if you have an odd number of source element children, the first group will be short one item. There are other methods available for grouping them differently and even according to data-driven criteria, for example if you need to determine dynamically how many groups you want. Cheers, Wendell At 01:34 PM 10/31/2005, you wrote: Hello, ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








