| Subject: [xsl] xsl:variable From: Laurence Mossuz <mossuz@xxxxxxxxxxxxx> Date: Thu, 06 Mar 2003 17:27:12 +0100 | 
hello
i would like to declare a variable counter in my xsl file and to
incremente it whenever i have the occurence toto in my XML file.
toto is a complextype whose maxOccurs="unbounded" in the schema
declaration.
For instance we can have in the xml file :
<test>
    <toto>
      <titi/>
      <tata/>
    </toto>
    <toto>
     <titi>hello</titi>
      <tata>bye</tata>
    </toto>
</test>
i would like to write something like this :
<xsl:variable name="counter" select="0"/>
<xsl:for-each select="toto">
    <xsl:variable name="counter" select="$counter+1"/>
</xsl:for-each>
i know that i'm wrong but how could i do that?
Many thanks for your help!!
Lo.
--
Laurence MOSSUZ
LAPP Service Informatique
Chemin de Bellevue BP 110
74941 Annecy-Le-Vieux CEDEX
Tel : 04 50 09 17 31 _ Fax : 04 50 27 94 95
 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
| Current Thread | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| RE: [xsl] for-each within a for-eac, Wendell Piez | Thread | Re: [xsl] xsl:variable, Oleg Tkachenko | 
| Re: [xsl] XSLT Consulting Market?, Jeff Kenton | Date | RE: [xsl] for-each within a for-eac, Andrew Welch | 
| Month |