Re: Rowcount
Michael Vincent van Rantwijk <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.layout.xslt |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Tomislav Bilic wrote: > Hello guys. > > I have a rather simple problem, but after a lot of research I couldn't > find right answer. > > This is the XSL sample and it works perfectly. It gets elements from XML > file. > > But, I would like to have line 3 changed for each iteration. > > iteration 1 : <div class="no1"> > iteration 2 : <div class="no2"> > iteration 3 : <div class="no3"> > > The question is, how to set a variable and increment it by 1 every > iteration. > > > <xsl:for-each select="dataroot/portfolio"> > <div class="portfolio_element"> > <div class="no1"> > <h4><xsl:value-of select="title"/></h4> > <div class="portfolio_ss"> > <xsl:element name="img"> > <xsl:attribute > name="src"><xsl:text>images/portfolio/</xsl:text><xsl:value-of > select="icon"/></xsl:attribute> > <xsl:attribute name="width"><xsl:text>90</xsl:text></xsl:attribute> > <xsl:attribute name="height"><xsl:text>79</xsl:text></xsl:attribute> > </xsl:element> > </div> > </div></div> > </xsl:for-each> > > > TNX in advance. Hey, I'm rather new to this (but find it very interesting) but can't you use <xsl:number for that? Michael