[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: position() returns what?
> But this outputs equal numbers: 2,4,6,8,10,... > I did expect that it would output 0,1,2,3,4,5 This is a FAQ (I'm sure itmustbe in teh faq file for this list) position() returns a number that is not a property of teh node (teh same node can have any number of position() values, for example if you select it with .. or . it always has position() =1. position() returns the position of the node in the current node list, and if that is the default selection for apply-templates this is child::node(0 which is all nodes including text nodes, so in your case the odd numbered nodes are all white space text nodes, if you added a template for them, <xsl:template match="text()"> <xsl:value-of select="position()"/> then you'd see it. change you apply tempaltes to use select="*" if you only want to process element children, or use xsl:strip-space to discard teh white space before processing begins. David -- http://www.dcarlisle.demon.co.uk/matthew ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ 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
|