This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Multiple Rows in a Table / Same Element


> 
> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]