[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: position() problem with // axis + parent numbering probl
> -----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
|
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
|