xsl-list
[Top] [All Lists]

RE: "position()" inside a sorted apply-templates (Akin to: sorted for-each: preceding::sibling is not in sort order)

2005-11-15 20:00:30
In the xsl:sort, position() refers to the position in the unsorted sequence.
[1]

In the called template, position() refers to the position in the sorted
sequence. [2]

[1] XSLT 1.0 section 10: "xsl:sort has a select attribute whose value is an
expression. For each node to be processed, the expression is evaluated with
that node as the current node and with the complete list of nodes being
processed in unsorted order as the current node list."

[2] XSLT 1.0 section 5.1: "A node is processed by finding all the template
rules with patterns that match the node, and choosing the best amongst them;
the chosen rule's template is then instantiated with the node as the current
node and with the list of source nodes as the current node list."

Note that position() returns the position of the current node within the
current node list. 

Can anybody point me to the clause in the standard where it 
covers axes context vs. function context?

It doesn't. Those are not concepts that the specification uses, they are
concepts you have invented for yourself.

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
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>
--~--