xsl-list
[Top] [All Lists]

[xsl] Position() in apply-templates

2014-04-01 16:19:14
Can someone clarify the meaning of "position()" in apply-templates.

According to Michael's Kay's 4th edition,

"When <xsl:apply-templates> or <xsl:for-each> is called to process a
sequence of nodes, the nodes ar enumbers 1 to N in their sorted order,
and while each node is being processed. the context position is the
number assigned to that node."

But I found a 2001 post indicating that, within an
<xsl:apply-templates> instruction *itself* the context position is
just the context position of the current node (_not_ the nodes being
selected by the select attribute of <xsl:apply-templates>). That post
is here=http://www.stylusstudio.com/xsllist/200105/post90830.html

My question is "When the "number assigned to that node" (as referenced
in Kay) is considered the context position? :

A. In the predicate of the select attribute of the
<xsl:apply-templates> instruction?
B. In the select attribute of any <xsl:with-param> instructions inside
the <xsl:apply-templates> instruction?
C. In the body of the <xsl:template> called by the
<xsl:apply-templates> instruction?


-David



-- 

"A false conclusion, once arrived at and widely accepted is not
dislodged easily, and the less it is understood, the more tenaciously
it is held." - Cantor's Law of Preservation of Ignorance.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>