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 30410 - [xslt30ts] current-output-uri() while evaluating sort keys and merge keys
Summary: [xslt30ts] current-output-uri() while evaluating sort keys and merge keys
Status: NEW
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 Test Suite (show other bugs)
Version: Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Abel Braaksma
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-06 21:16 UTC by Michael Kay
Modified: 2019-03-08 14:30 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2019-03-06 21:16:26 UTC
Tests current-output-uri-009 and current-output-uri-010 assume that the current output URI is absent while evaluating sort keys and merge keys.

I can find no basis for this in the specification.

The spec doesn't say that the current-output-uri changes in this situation and therefore my reading would be that it doesn't.
Comment 1 Abel Braaksma 2019-03-08 14:30:32 UTC
I find this one tricky. We say about the current output URI:

[Definition: The current output URI is the URI associated with the principal result or secondary result that is currently being written.]

A principal or secondary result is only being written when we are in final output state. About temporary output state we say:

[Definition: The second of the two output states is called temporary output state. This state applies when instructions are writing to a temporary tree or any other non-final destination.] 

And we say about xsl:result-document:

[ERR XTDE1480] It is a dynamic error to evaluate the xsl:result-document instruction in temporary output state. 

It has always been my understanding that the current output URI is absent in temporary output state. I think this relation makes sense. We make one explicit exception to this rule:

"The current output URI is not cleared when evaluating a local variable, even though xsl:result-document cannot be used while evaluating a local variable."

This exception-to-the-rule explicitly links current output URI to the availability of xsl:result-result-document.

We say about clearing the temporary output state:

"xsl:variable, xsl:param, xsl:with-param, xsl:function, xsl:key, xsl:sort, xsl:accumulator-rule, and xsl:merge-key always evaluate the instructions in their contained sequence constructor in temporary output state."

Since evaluation of sort and merge keys are in temporary output state, it follows that the current output URI is (ought to be) absent. At least that is my interpretation.