[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl function position() used to fill attribute "name"
hello everybody, my xml file is like this <test> <toto> <titi>ti1</titi> <tata>ta1</tata> </toto> <toto> <titi>ti2</titi> </toto> <toto> <tata>ta3</titi> </toto> <toto/> </test> and a part of my xsl file is like this <xsl:for-each select="toto"> <tr> <td> <xsl:choose> <xsl:when test="string(titi)"> <xsl:value-of select="titi"/> </xsl:when> <xsl:otherwise> <input name="titi{position()}" type="text"/> </xsl:otherwise> </xsl:choose> </td> <td> <xsl:choose> <xsl:when test="string(tata)"> <xsl:value-of select="tata"/> </xsl:when> <xsl:otherwise> <input name="tata{position()}" type="text"/> </xsl:otherwise> </xsl:choose> </td> </tr> </xsl:for-each> i just want to be sure that tata{position()} is equal to the position of the node tata in the xml document. Besides, if i want to define the "name" attribute as the concatenation of a string, test/toto/tata, and the tata{position()}result, is it correct to write <input name="test/toto/tata+tata{position()}" type=text"}? many thanks for your help! Miss Laurence Mossuz -- 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|