[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: displaying position of nodes

Subject: Re: displaying position of nodes
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 21 Feb 2003 07:07:00 +0100
 Re: displaying position of nodes
> Notice that position() gives you the position of an element relative to
> the top of the subtree it is in when matched by a template, and not
> necessarily the element count as you might have been expecting.


This is not true. The value of position() is determined by the relative
position of the current node in the node-list when the template is
instantiated -- that is by the expression in the "select"  attribute of the
xsl:apply templates that caused the instantiation.

For example, if the instantiation was caused by:

<xsl:apply-templates select="node()[3]"/>

then in the instantiated template

<xsl:value-of select="position()"/>

will produce '1'


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL




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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.