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 2001 - R-023: Restrictions of attributes specifying "use"
Summary: R-023: Restrictions of attributes specifying "use"
Status: CLOSED INVALID
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.0 only
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Henry S. Thompson
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-07 19:45 UTC by Sandy Gao
Modified: 2009-04-21 19:24 UTC (History)
0 users

See Also:


Attachments

Description Sandy Gao 2005-09-07 19:45:01 UTC
The constraints listed for "derivation-ok-restriction" do not appear to 
prohibit the following: 

<xsd:complexType name="baseType">
     <xsd:attribute name="attrib1" type="xsd:string" use="prohibited"/>
<xsd:complexType>

<xsd:complexType name="restrictedType">
     <xsd:complexContent>
          <xsd:restriction base="baseType">
               <xsd:attribute name="attrib1" type="xsd:string" use="required"/>
          </xsd:restriction>
     </xsd:complexContent>
</xsd:complexType>
Shouldn't this be disallowed, since instances of the restricted type are not 
valid instances of the base?

See
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2001AprJun/0225.html
Comment 1 Sandy Gao 2005-09-07 19:46:52 UTC
This restriction is already disallowed by the Structures spec. In the base 
type, there is no component for the attribute because of the use="prohibited". 
Given this, clause 2.2 of Schema Component Constraint: Derivation Valid 
(Restriction, Complex) applies and causes this example to be invalid.

No erratum is required.