W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2008

[Bug 5480] Substitution groups and

From: <bugzilla@wiggum.w3.org>
Date: Thu, 14 Feb 2008 12:19:34 +0000
To: public-qt-comments@w3.org
Message-Id: <E1JPd3u-0002rP-QC@wiggum.w3.org>


           Summary: Substitution groups and
           Product: XML Query Test Suite
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XML Query Test Suite
        AssignedTo: andrew.eisenberg@us.ibm.com
        ReportedBy: nick@cbcl.co.uk
         QAContact: public-qt-comments@w3.org

Consider a schema:

<schema targetNamespace="http://www.w3.org/XQueryTest/testcases"
  <element name="root">
        <element ref="tc:schema-element-head"/>
  <element name="schema-element-head" type="string"/>
  <element name="schema-element-group" type="string"

And $input-context bound to the document:

<tc:root xmlns:tc="http://www.w3.org/XQueryTest/testcases">

And the query

import schema namespace tc="http://www.w3.org/XQUeryTest/testcases";
declare variable $input-context1 as document-node(schema-element(tc:root))

Clearly the expected result should be the schema-element-group element, but I
think the typing rules give the type of the axis expression as empty-sequence.

$input-context has type: document ( element tc:root of Type )
where Type is element tc:element-schema-head of xsd:string

Firstly I don't no believe any of the judgements (particularly the with union
interpretation judgement) cause tc:element-schema-group to be included in Type

Hence we ended up wanting to make the judgement from

statEnv |- test tc:schema-element-group with element of element
tc:schema-element-head of xsd:string : element tc:schema-element-group of

In the recommendation I don't think this case is caught, as clearly the QNames
schema-element-group and schema-element-head don't match. But I don't think it
is caught by the "Lastly, if none of the above rules holds, then the type of
the input expression is empty." as the line:

statEnv |-  not(element ElementNameOrWildcard 1 TypeSpecifier1 <: element
ElementNameOrWildcard 2 TypeSpecifier2)

is false as I believe

element tc:schema-element-group <: element tc:schema-element-head

is true, as subtyping (<:) is true if every value which "matches" the first
type also "matches" the second, and the "matches" judgement uses judgements
"name lookup" and hence "substitutes for".

I think this problem was noted in #4261, and fixed in the erratum. And I now
agree the final empty-sequence case covers what is not covered in the prior
cases, particularly with rule 13, but I'm am unsure if it is fixed in the
correct way, as now it would cause the above query to statically type to the
empty-sequence. Should the change not be one using subtyping rather than name
matching for the prior static judgements?
Received on Thursday, 14 February 2008 12:19:58 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:35 UTC