[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

Subject: context (size) when evaluating use expression of an xsl:key
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Fri, 05 Feb 2010 15:50:24 +0100
 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/

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.