RE: Curious result of the position() function
> From: David Carlisle [mailto:davidc@xxxxxxxxx] > > I believed that the position() function should give me the position > number > > of the node in the node set. > > "set" always implies an unordered data structure, there is no postion in > a set. It does give the position in the current node list, which in thi > scase consists of, alternately an element node and a text node (with > white space in it) Just to augment what David said, you will get the expected results if you select just the specific nodes you are interested in. For example, this will give you the position() results you expected - <xsl:template match="/"> <result> <xsl:apply-templates select='/document/table/row'/> </result> </xsl:template> Now, only the "row" elements get fed to the template, so the position() values reflect a row's position among just the other rows. Cheers, Tom P
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