[Bug 6561] Type Substitutable in Restriction

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





--- Comment #8 from Hans-Juergen Rennau <hrennau@yahoo.de>  2009-03-02 07:08:44 ---
(In reply to comment #7)
> I think both of you are correct in that the contradiction doesn't exist. I
> missed the phrase "the first case" in clause 1 of the CDTT definition.
> 
> (Because of EDC, I naively thought it was not necessary to use "the first
> case", as EDC should/would guarantee that 1.1 and 1.2 will produce the same
> result.)
> 
> So I'm ready to withdraw the first half of my comment #3, given that there is
> no new information. I'm leaving this bug as "reopened", because I believe the
> process is that once you submit a comment, you can't just take it back.
> 
> Also it's not clear to me whether the WG needs/wants to take an explicit action
> on the second half of comment #3 (about anyType).
> 

By now I am convinced that you are right in your intuition that allowing skip
wildcards to determine a CDTT might introduce inconsistency. 

A simple example demonstrates this. Consider this schema:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="e2" type="t2"/>
  <xs:element name="b" type="xs:integer"/>

  <xs:complexType name="t1">
    <xs:sequence>
      <xs:element name="a" type="xs:string"/>
      <xs:any processContents="skip"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="t2">
    <xs:complexContent>
      <xs:extension base="t1">
        <xs:sequence>
          <xs:element name="b" type="xs:date"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

</xs:schema>

Then any element validated against element declaration e2 will be invalid,
because applying "Conditional Type Substitutable in Restriction" to child
element b (with T=t2, B=t1) yields:
ST = xs:date
SB = xs:integer

that is, ST != SB, a violation of the constraint. If the global and the local
element declaration indeed contained type tables (<alternative> children) the
problem could be removed by ignoring skip wildcards when determining the CDTT,
as you suggested (that is, by modifying clause 1.2 of the CDTT definition).

However, if global and local declaration do not contain type tables - as was
the case in the example - the CDTTs are "effective type tables" (constructed
from {type definition}), and then the wildcard's {process contents} becomes
irrelevant, as "3.8.6.3 Element Declarations Consistent" does not safeguard
against differences of {type definition} in the absence of {type table}. To
address this issue, I am going to open a separate bug report.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 2 March 2009 07:08:53 UTC