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]
Other format: [Raw text]

RE: conditional html


Try:

<xsl:for-each select="rows[position() mod 6=0">
	<tr><xsl:value-of select="someNode"/></tr>
</xsl:for-each>

HTH!

Dion

-----Original Message-----
From: Paul Knepper [mailto:pknepper@CardioNOW.com] 
Sent: Tuesday, May 07, 2002 11:50 AM
To: 'XSL-List@lists.mulberrytech.com'
Subject: [xsl] conditional html

How can I insert conditional html?  I want to iterate over a set of
nodes
("rows" in the example below) and format a table row for every sixth
item.

I tried the following, but of course its an unbalanced xml file:


<xsl:for-each select="rows">
  <xsl:if test="(position() mod 6) = 1">
    <tr>
  </xsl:if>

  <xsl:value-of select="someNode"/>

  <xsl:if test="(position() mod 6) = 0">
    </tr>
  </xsl:if>
</xsl:for-each>

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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]