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 5504 - Annotations can vary in an extension? Why?
Summary: Annotations can vary in an extension? Why?
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: Macintosh All
: P2 minor
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: resolved
Depends on:
Blocks: 5583
  Show dependency treegraph
 
Reported: 2008-02-26 23:52 UTC by C. M. Sperberg-McQueen
Modified: 2008-05-31 03:36 UTC (History)
0 users

See Also:


Attachments

Description C. M. Sperberg-McQueen 2008-02-26 23:52:13 UTC
Both in XSD 1.0 and in XSD 1.1, the schema component constraint
Particle Valid (Extension), which is used to check that born-binary
extensions are OK (extensions made from schema documents are 
guaranteed OK by construction), contains the rule

  2 E's {min occurs}={max occurs}=1 and its {term} is a 
    sequence group whose {particles}' first member is a 
    particle all of whose properties, recursively, are identical 
    to those of B, with the exception of {annotation} properties.

Leaving aside the problematic appeal to an undefined identity
of property values, the final exception seems to say that for
born-binary schemas, the annotations on elements in the base
type can change in an extension.

To be concrete, consider the content model (A, B), with annotations
on the A and the B saying, respectively, color=red and color=green.
I'll write this 

  (A [color=red], B [color=green])

If I'm reading the spec correctly, the following content model would
be a legal extension of this type:

  (A [color=green], B [color=red], C [color=amber])

This seems to violate the principle that all schemas should be
expressible using schema documents; it also seems in and of itself
to have a high astonishment factor.

Is the rule (a) a typo in 1.0 that has been preserved in 1.1?
(b) a design error?  (c) a correct design decision whose rationale
is not obvious to the careless and impatient reader (such as me)?

If (a), then I believe the error should be corrected both in 1.0 
and in 1.1.  If (b), then it should be corrected in 1.1, but 
probably needs to be left alone in 1.0.  If (c), then I believe 
the design rationale should be given in a note (taking my 
bewilderment as demonstrating that some readers, at least, will
find the rule bewildering).
Comment 1 C. M. Sperberg-McQueen 2008-03-21 18:01:25 UTC
The XML Schema WG agreed today (21 March 2008) that this is a bug that
needs to be fixed as described in (a).  Bug 5583 is the 1.0 clone of this
bug; this bug (5504) is being changed to point to 1.1 only.
Comment 2 C. M. Sperberg-McQueen 2008-05-29 06:50:14 UTC
A wording proposal intended to resolve this issue is at
http://www.w3.org/XML/Group/2004/06/xmlschema-1/structures.b5504.html
(member-only link).
Comment 3 C. M. Sperberg-McQueen 2008-05-31 03:36:16 UTC
The wording proposal mentioned in comment #2, which is the same as the
proposal in the initial bug report, was adopted by the WG on its call
today.  With that, the WG believes this issue is resolved.