[Bug 25185] New: Usage absorption can take crawling expressions when TDU derives from xs:anyAtomicType

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25185

            Bug ID: 25185
           Summary: Usage absorption can take crawling expressions when
                    TDU derives from xs:anyAtomicType
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: XSLT 3.0
          Assignee: mike@saxonica.com
          Reporter: abel.braaksma@xs4all.nl
        QA Contact: public-qt-comments@w3.org

Functions that take an atomized value that has an occurrence indicator of one
or zero-or-one, can be allowed to take a crawling expression as an argument.

This is true, because it is an error if the expression returns more than one
node, and it is possible in the same way as for fn:count(x) to determine at
runtime whether more than one nodes are returned, resulting in the dynamic
error XPTY0004[1].

This simplifies scenarios where the user is not interested in the depth of a
certain node, but knows beforehand that there will only ever be one matching
node, and if not, accepts it as an error scenario.

Example:

<xsl:value-of select="string(proto//version)" />

Currently, this is not streamable, but if there are more than one matches, this
would result in an error. If there is zero or one match, it is streamable.
Hence, it is streamable in both cases and we can consider this a normal
consuming expression.

This rule can apply to all functions (and therefor can simply be added to the
general streamability rules), even user-defined ones, that have an argument
that derives from xs:anyAtomicType with occurrence indicator zero, or
zero-or-one. For instance, included are fn:ceiling, fn:dateTime, fn:string,
fn:concat, fn:format-date, fn:error, but excluded are fn:data, fn:deep-equal,
fn:min, fn:max.

This bug report was "inspired" by researching backwards compatibility behavior
for bug 24506, comment 5.

[1] http://www.w3.org/TR/xpath-30/#ERRXPTY0004

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 27 March 2014 23:39:33 UTC