[Bug 2208] R-216: Potential problem with Name and Type OK

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

           Summary: R-216: Potential problem with Name and Type OK
           Product: XML Schema
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSD Part 1: Structures
        AssignedTo: ht@w3.org
        ReportedBy: sandygao@ca.ibm.com
         QAContact: www-xml-schema-comments@w3.org


The constraint for NameAndTypeOK is as follows: 

Schema Component Constraint: Particle Restriction OK (Elt:Elt -- NameAndTypeOK) 

For an element declaration particle to be a valid restriction of another 
element declaration particle all of the following must be true: 
1 The declarations' {name}s and {target namespace}s are the same. 
2 Either B's {nillable} is true or R's {nillable} is false. 
3 R's occurrence range is a valid restriction of B's occurrence range as 
defined by Occurrence Range OK (3.9.6). 
4 either B's declaration's {value constraint} is absent, or is not fixed, or 
R's declaration's {value constraint} is fixed with the same value. 
5 R's declaration's {identity-constraint definitions} is a subset of B's 
declaration's {identity-constraint definitions}, if any. 
6 R's declaration's {disallowed substitutions} is a superset of B's 
declaration's {disallowed substitutions}. 
7 R's {type definition} is validly derived given {extension, list, union} from 
B's {type definition} as defined by Type Derivation OK (Complex) (3.4.6) or 
Type Derivation OK (Simple) (3.14.6), as appropriate. Note: The above 
constraint on {type definition} means that in deriving a type by restriction, 
any contained type definitions must themselves be explicitly derived by 
restriction from the corresponding type definitions in the base definition, or 
be one of the member types of a corresponding union. 

Some issues: 
- It's not mentioned what's B and what's R. The first sentence should be 
modified to something similar to "For an element declaration particle R to be a 
valid restriction of another element declaration particle R all of the 
following must be true:". 
- Since B and R are particles, bullets 2 and 7 are not correct in saying B's 
{nillable} or R's {type definition}. I think the first sentence can be further 
modified to "For a particle R whose {term} is an element declaration RE to be a 
valid restriction of another particle B whose {term} is an element declaration 
BE all of the following must be true:", then use RE and BE in the proper 
places. 

Proposed text: 

Schema Component Constraint: Particle Restriction OK (Elt:Elt -- NameAndTypeOK) 

For a particle R whose {term} is an element declaration RE to be a valid 
restriction of another particle B whose {term} is an element declaration BE all 
of the following must be true: 
1 RE and BE have the same {name}s and {target namespace}s. 
2 Either BE's {nillable} is true or RE's {nillable} is false. 
3 R's occurrence range is a valid restriction of B's occurrence range as 
defined by Occurrence Range OK (3.9.6). 
4 Either BE's {value constraint} is absent, or is not fixed, or RE's {value 
constraint} is fixed with the same value. 
5 RE's {identity-constraint definitions} is a subset of BE's {identity-
constraint definitions}, if any. 
6 RE's {disallowed substitutions} is a superset of BE's {disallowed 
substitutions}. 
7 RE's {type definition} is validly derived given {extension, list, union} from 
BE's {type definition} as defined by Type Derivation OK (Complex) (3.4.6) or 
Type Derivation OK (Simple) (3.14.6), as appropriate. Note: The above 
constraint on {type definition} means that in deriving a type by restriction, 
any contained type definitions must themselves be explicitly derived by 
restriction from the corresponding type definitions in the base definition, or 
be one of the member types of a corresponding union. 

See:
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2003JanMar/0046.html

Received on Wednesday, 14 September 2005 19:12:28 UTC