W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

attributes on complexType from other namespace

From: Takuki Kamiya <takuki@pacbell.net>
Date: Tue, 29 Jan 2002 15:46:04 -0800
Message-ID: <005e01c1a91f$1e7d4110$d501510a@iona.com>
To: <xmlschema-dev@w3.org>
Hi,

"3.4.2 XML Representation of Complex Type Definitions" illustrates that
any attributes with non-schema namespace are allowed for "complexType"
definition element.

However, schema for schemas does not seem to allow for this.
"complexType" element is of type "topLevelComplexType", of which
"openAttrs" is the ancestor that specifies attribute wildcard.
However, in the derivation chain there is derivation-by-restriction
used so that the wildcard attribute does not get inherited in
"topLevelComplexType".

I think "topLevelComplexType" needs to specify attribute wildcard
explicitly on its own.

-Takuki Kamiya



Following is an excerpt from schema for schemas.

 <xs:complexType name="openAttrs">
   <xs:annotation>
     <xs:documentation>
       This type is extended by almost all schema types
       to allow attributes from other namespaces to be
       added to user schemas.
     </xs:documentation>
   </xs:annotation>
   <xs:complexContent>
     <xs:restriction base="xs:anyType">
       <xs:anyAttribute namespace="##other" processContents="lax"/>
     </xs:restriction>
   </xs:complexContent>
 </xs:complexType>

 <xs:complexType name="annotated">
   <xs:annotation>
     <xs:documentation>
       This type is extended by all types which allow annotation
       other than &lt;schema&gt; itself
     </xs:documentation>
   </xs:annotation>
   <xs:complexContent>
     <xs:extension base="xs:openAttrs">
       <xs:sequence>
  <xs:element ref="xs:annotation" minOccurs="0"/>
       </xs:sequence>
       <xs:attribute name="id" type="xs:ID"/>
     </xs:extension>
   </xs:complexContent>
 </xs:complexType>


 <xs:complexType name="complexType" abstract="true">
  <xs:complexContent>
   <xs:extension base="xs:annotated">
    <xs:group ref="xs:complexTypeModel"/>
    <xs:attribute name="name" type="xs:NCName">
     <xs:annotation>
      <xs:documentation>
      Will be restricted to required or forbidden</xs:documentation>
     </xs:annotation>
    </xs:attribute>
    <xs:attribute name="mixed" type="xs:boolean" use="optional"
default="false">
     <xs:annotation>
      <xs:documentation>
      Not allowed if simpleContent child is chosen.
      May be overriden by setting on complexContent
child.</xs:documentation>
    </xs:annotation>
    </xs:attribute>
    <xs:attribute name="abstract" type="xs:boolean" use="optional"
default="false"/>
    <xs:attribute name="final" type="xs:derivationSet"/>
    <xs:attribute name="block" type="xs:derivationSet"/>
   </xs:extension>
  </xs:complexContent>
 </xs:complexType>

 <xs:complexType name="topLevelComplexType">
  <xs:complexContent>
   <xs:restriction base="xs:complexType">
    <xs:sequence>
     <xs:element ref="xs:annotation" minOccurs="0"/>
     <xs:group ref="xs:complexTypeModel"/>
    </xs:sequence>
    <xs:attribute name="name" type="xs:NCName" use="required"/>
   </xs:restriction>
  </xs:complexContent>
 </xs:complexType>
Received on Tuesday, 29 January 2002 20:40:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT