W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2005

[Bug 2205] R-213: Question about attribute wildcards and restriction

From: <bugzilla@wiggum.w3.org>
Date: Wed, 14 Sep 2005 19:09:40 +0000
To: www-xml-schema-comments@w3.org
Message-Id: <E1EFcdY-0000mx-N8@wiggum.w3.org>


           Summary: R-213: Question about attribute wildcards and
           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

This is a recap of an possible erratum discussed within the Schema IG. 

Because attribute wildcards have a "lazy" behavior, it's possible for an 
apparently-valid restriction to violate the general notion of restriction. 
By "lazy" I mean the property that an attribute-wildcard will only match an 
attribute-information-item (AII) if no other attribute-use matches the AII. 

Best demonstrated by example: 

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

   <xs:complexType name="B">
     <xs:attribute name="FOO" type="xs:int"/>
     <xs:anyAttribute processContents="skip"/>

   <xs:complexType name="A">
       <xs:restriction base="B">
         <xs:attribute name="FOO" type="xs:int" use="prohibited" />
         <xs:anyAttribute processContents="skip" />


I believe this is a valid restriction per the rules of restriction, but not by 
the general definition in Section 2, which includes 

Members of a type, A, whose definition is a restriction of the definition of 
another type, B, are always members of type B as well. 

B doesn't accept an element with attribute FOO="abc", but A does accept it. 
That's because A doesn't contain an attribute-use for FOO, so the attribute-
wildcard validates FOO in A. 

Received on Wednesday, 14 September 2005 19:09:53 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:04 UTC