Subject: Re: [xsl] knowing the position of certain node From: Mukul Gandhi <mukulgandhi2003@xxxxxxxxxxx> Date: Tue, 6 Jan 2004 13:57:32 +0000 (GMT) |
Hi Jaime, Please try the following XSL Template ;) <xsl:template match="/test"> <xsl:for-each select="row"> <xsl:if test = "field2 = 'yes'"> <xsl:value-of select="position()" /> </xsl:if> </xsl:for-each> </xsl:template> Regards, Mukul --- Jaime A Stuardo Bahamondes <jstuardo@xxxxxxxxxxx> wrote: > Hi all.. > > I have this sample XML: > > <test> > <row> > <field1>this</field1> > </row> > <row> > <field1>is</field1> > </row> > <row> > <field1>a</field1> > <field2>yes</field2> > </row> > <row> > <field1>test</field1> > </row> > </test> > > > If I use <xsl:value-of select="row[field2 = 'yes']" > /> I get all the third "row" field values. How can I > know the position of the found node? for example, in > that case, I want 3 to be printed on screen, > something like "position(row[field2 = 'yes'])" > > Thanks > Jaime > > XSL-List info and archive: > http://www.mulberrytech.com/xsl/xsl-list > ________________________________________________________________________ Yahoo! India Mobile: Download the latest polyphonic ringtones. Go to http://in.mobile.yahoo.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] knowing the position of c, George Cristian Bina | Thread | RE: [xsl] knowing the position of c, Michael Kay |
RE: [xsl] Maximum file size, kakridge | Date | Re: [xsl] Looking up keys in a sepa, Anthony Zawacki |
Month |