[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: Multiple Rows in a Table / Same Element


Subject: RE: Multiple Rows in a Table / Same Element
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Wed, 9 Aug 2000 09:57:22 +0100

> 
> 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() &lt; 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



Current Thread