[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Re: position() counting by 2's


Subject: [xsl] Re: position() counting by 2's
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Mon, 1 Apr 2002 09:47:00 -0800 (PST)

> It appears that position() is counting by twos.  In the below 
> example, I am using the position() function
> to number my output.  I would like to number starting from 0.
> 
> The values that $NavNumber takes on are (1, 3, 5) and 
> $CorrectedNavNumber are (0, 1, 3)

This is because there are white-space only nodes in the node-list. They
are between your element nodes and also have position.

To eliminate this problem, put the following XSLT instruction in a
global scope near your xsl:stylesheet

<xsl:strip-space elements="*"/>

Hope this helped.

Cheers,
Dimitre Novatchev.




__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords