[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] context (size) when evaluating use expression of an x
How is the context defined when evaluating the 'use' attribute of an
'xsl:key' element, in particular what is the context size?
The XSLT specification in http://www.w3.org/TR/xslt20/#key merely says: "The expression will be evaluated with the node that matches the pattern as the context node." but it does not say what is the context size. I get different results from different XSLT processors, if the input XML is <root> <data> <item>1</item> <item>2</item> <item>3</item> </data> </root> and the stylesheet is <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="text"/> <xsl:key name="k1" match="item" use="position()"/> <xsl:template match="/"> <xsl:value-of select="key('k1', 1)"/> </xsl:template> </xsl:stylesheet> then Saxon (tested with 9.2.0.5) and Gestalt output 1 2 3 meaning the context size is 1 each time the 'use' expression has been evaluated but AltovaXML tools and IBM's beta output 1 meaning the context size is not 1 for these processors. I suspect Saxon and Gestalt are right but I am having a hard time to find an argument for that in the specification. -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|
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
|