Subject: RE: position() problem with // axis + parent numbering problem From: Kay Michael <Michael.Kay@xxxxxxx> Date: Tue, 18 Apr 2000 11:28:32 +0100 |
> -----Original Message----- > From: Warren Hedley [mailto:w.hedley@xxxxxxxxxxxxxx] > Sent: 18 April 2000 10:51 > To: xsl-list@xxxxxxxxxxxxxxxx > <xsl:for-each select="//text[1]"> > <xsl:text>First node (</xsl:text> > <xsl:value-of select="position()" /> > <xsl:text>) = `</xsl:text> > <xsl:value-of select="." /> > <xsl:text>' > </xsl:text> > </xsl:for-each> > > <xsl:for-each select="//text[not(position() = 1)]"> > <xsl:text>Text (</xsl:text> > <xsl:value-of select="position()" /> > <xsl:text>) = `</xsl:text> > <xsl:value-of select="." /> > <xsl:text>' > </xsl:text> > </xsl:for-each> > You're getting confused here between position() inside a predicate and position() outside a predicate. The position() you're testing in the for-each expression is the position of the <text> element relative to its siblings. The position() you're evaluating in the value-of expression is the position within the set of things being processed by the for-each. XSLT may be side-effect free, but it's not context-free! Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: position() problem with // axis, Kay Michael | Thread | sort & remove duplicates, Mark Volkmann |
RE: Variable Scope and xsl:if, Kay Michael | Date | RE: How do I generate a hanging ind, Wendell Piez |
Month |