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 30196 - [xslt30ts] There is no mechanism to return a sequence as the transformation result
Summary: [xslt30ts] There is no mechanism to return a sequence as the transformation r...
Status: RESOLVED FIXED
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: 2017-11-11 23:12 UTC by Michael Kay
Modified: 2019-03-09 12:57 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2017-11-11 23:12:58 UTC
We have a mechanism

<output tree="no"/>

to indicate that the result of a transformation should not be turned into a tree by applying sequence normalization. However, in this case the test assertions still rely on binding the result as the context item, which doesn't work if the result is a sequence. It is therefore impossible to test stylesheets that return a non-singleton sequence as their result.

This also makes it difficult to convert QT3 tests, which often return a sequence as the result. In QT3, assertions refer to this sequence as $result.

I propose to introduce the option

<output tree="no" result-var="result"/>

to indicate that the result of the stylesheet is bound to the variable $result rather than to the context item.
Comment 1 Abel Braaksma 2019-02-25 13:52:37 UTC
Closing old bug.

I agree. I've seen this change applied and I've updated test drivers to use this, the approach seems logical to me.
Comment 2 Abel Braaksma 2019-03-09 12:57:56 UTC
> <output tree="no" result-var="result"/>

For posterity, the documentation reads currently that the value can be yes/no. The XSD shows an xs:NCName, and I found one usage in the test sets, value "result" for $result. I'll update the documentation according to the current usage.