xsl-list
[Top] [All Lists]

Re: [xsl] Grouping based on the sum of an attribute

2007-01-26 10:41:07

<xsl:variable name="tcols" select="@cols"/>
<xsl:for-each-group select="*"
group-by="sum(@cols,preceding-sibling::*/@cols) idiv $tcols">

then:


$ saxon8 st.xml st.xsl \!indent=yes
<?xml version="1.0" encoding="UTF-8"?>
<table>
   <tr>
      <th colspan="3" rowspan="1">
                Head
        </th>
   </tr>
   <tr>
      <td colspan="1" rowspan="1">
                Column 1
        </td>
      <td colspan="1" rowspan="1">
                Column 2
        </td>
      <td colspan="1" rowspan="1">
                Column 3
        </td>
   </tr>
</table>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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