This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27012 - [xslt 3.0] xsl:context-item: apply conversion rules?
Summary: [xslt 3.0] xsl:context-item: apply conversion rules?
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-09 19:16 UTC by Michael Kay
Modified: 2014-10-24 10:52 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2014-10-09 19:16:07 UTC
Section 10.1.1 (xsl:context-item) makes conflicting statements about whether or not the context item is converted to the required type.

First it says:

No attempt is made to convert the context item to the required type (using the function conversion rules or otherwise).

Later it says:

If a context item is supplied (which will automatically be the case if the template is invoked using xsl:apply-templates, xsl:apply-imports, or xsl:next-match) then it will be converted to the required type by applying the function conversion rules; a type error [see ERR XTTE0590] occurs if conversion to the required type is not possible.

Both designs are feasible, but I'm inclined to go for the "no conversion" option to avoid complications. For example, if a template matches a node and then atomizes it for processing, what does xsl:next-match do?
Comment 1 Michael Kay 2014-10-13 09:17:32 UTC
Note that xsl:global-context-item says unambiguously that the supplied item *is* converted to the required type. In this case I don't see the same complications arising, but on the other hand, there's no real need for conversion in practice, given that the declared global context item type will almost invariably be a node test, and if the required type is a node then no conversion happens anyway.
Comment 2 Michael Kay 2014-10-16 16:59:33 UTC
The WG decided that no conversion should occur for xsl:context-item but conversion should occur for xsl:global-context-item.