Subject: Re: [xsl] Current node position From: "Corey Wilson" <corey@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 11 Jun 2003 15:44:41 -0400 |
you could try putting the date in a variable <variable name="dateList" select="./date" /> then do the position and count of $dateList ----- Original Message ----- From: "jwhitney" <jwhitney@xxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, June 11, 2003 14:55 Subject: [xsl] Current node position > Hello, > > I'm trying to generate html code for "Date 1 of 2", "Date 2 of 2", etc., from > XML as below: > > <a> > <b/> > <c/> > <date>text</date> > <date>text again</date> > </a> > > from within a template that matches "d". The following stylesheet fragment: > > <xsl:template match="d"> > <xsl:value-of select="position()" /> > <xsl:text> of </xsl:text> > <xsl:value-of select="count(../date)" /> > </xsl:template> > > produces "3 of 2" and "4 of 2". Is there a way to restrict position() to > evaluate the <date> nodes only? How else could it be done? > > I'm new to XSLT, obviously. Thanks in advance for any help with this. > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Current node position, G. Ken Holman | Thread | RE: [xsl] Current node position, Michael Kay |
Re: [xsl] xsl:for-each evaluator?, Corey Wilson | Date | Re: [xsl] Processing a <br> in XSL-, G. Ken Holman |
Month |