This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: position() counting by 2's


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]