[Bug 3312] XPST0080, XPST0003 and XPST0051 overlaps

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3312

           Summary: XPST0080, XPST0003 and XPST0051 overlaps
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: frans.englich@telia.com
         QAContact: public-qt-comments@w3.org


XPST0080 reads as follows:

'The target type must be an atomic type that is in the in-scope schema types
and is not xs:NOTATION or xdt:anyAtomicType, optionally followed by the
occurrence indicator "?" to denote that an empty sequence is permitted
[err:XPST0080]'

XPST0051:

"If a QName that is used as an AtomicType is not defined as an atomic type in
the in-scope schema types, a static error is raised [err:XPST0051]."

XPST0051 and XPST0080 overlaps when a non-atomic type is referred to in a
cast/castable as expression. Examples:

$input cast as xs:anyType
or
$input cast as xs:doesNotExist

That XPST0080 also discusses the absence(or presence) of '?', making it overlap
with XPST0003. I don't think it has to mention '?' because the grammar clearly
specifies it, as for all other expressions. I think it would reduce potential
overlaps by not discussing '?' in the definition of XPST0080.

I suggest to reduce the scope of XPST0080. Proposed wording:

In the first paragraph, replace:

"The target type must be an atomic type that is in the in-scope schema types
and is not xs:NOTATION or xs:anyAtomicType, optionally followed by the
occurrence indicator "?" to denote that an empty sequence is permitted
[err:XPST0080]."

with:

"The target type must be an atomic type that is in the in-scope schema
types[XPST0051]. In addition, the target type cannot be xs:NOTATION or
xs:anyAtomicType[XPST0080]. The optional occurrence indicator "?" denotes that
an empty sequence is permitted."


Frans

Received on Monday, 5 June 2006 14:33:30 UTC