This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Multiple Rows in a Table / Same Element
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Multiple Rows in a Table / Same Element
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Wed, 9 Aug 2000 09:57:22 +0100
- Reply-To: xsl-list at mulberrytech dot com
>
> I am trying to create a Calendar table with a new row after
> every 7th day.
>
Look in the FAQ under grouping.
The basic principle is to structure template rules according to the output
structure, not the input structure. You want a rule that generates a <week>
element containing seven <day> elements? Write it like this:
<xsl:template match="day[position() mod 7 = 0]"/>
<week>
<xsl:for-each select=". | following-sibling::day[position() < 7]">
<day><xsl:value-of select="@date"/></day>
</xsl:for-each>
</week>
</xsl:template>
<xsl:template match="day"/> <!-- ignore the other days -->
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list