Re: [xsl] question on EXSLT data partitioning
Subject: Re: [xsl] question on EXSLT data partitioning|
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 20 Oct 2010 16:17:49 +0200
Erwan AMOUREUX wrote:
I frequently use this with msmxl or altova engine.
In that case, it's a 'default' position() by parent node , using the xml tree entirely .
Well the XSLT 2.0 specification at least is clear about that, see
http://www.w3.org/TR/xslt20/#key which says "When the key specifier of
that xsl:key declaration is evaluated with a singleton focus based on
$N". Singleton focus means "A singleton focus based on a node N has the
context item (and therefore the context node) set to N, and the context
position and context size both set to 1".
I am sure some months ago I filed a bug on the AltovaXML Tools engine
and at least their XSLT 2.0 engine in the version "AltovaXML Community
Edition Version 2011" correctly implements that by now. So with the XML
and the stylesheet being
<xsl:key name="context-position" match="foo" use="position()"/>
<xsl:key name="context-size" match="foo" use="last()"/>
<xsl:value-of select="count(key('context-position', 1)),
count(key('context-size', 1))" separator=" "/>
the result is
with both Saxon 9.2 and the AltovaXML Tools engine with the version