RE: declaration with 'type' attribute must not have nested type declaration

> -----Original Message-----
> From:	Joseph M. Reagle Jr. [SMTP:reagle@w3.org]
> Sent:	Monday, July 10, 2000 1:25 PM
> To:	www-xml-schema-comments@w3.org
> Subject:	declaration with 'type' attribute must not have nested type
> declaration
> 
> I don't understand this error (can we not have our own ds:type element or
> attribute?); which part of the schema spec addresses this?
> 
> http://www.w3.org/2000/06/webdata/xsv?docAddrs=http%3A%2F%2Fpolicy.w3.org%
> 2FWD-xmldsig-core-20000711%2Fsignature-example.xml+http%3A%2F%2Fpolicy.w3.
> org%2FWD-xmldsig-core-20000711%2Fxmldsig-core-schema.xsd&keepGoing=on&styl
> e=msxsl
> 
> http://policy.w3.org/WD-xmldsig-core-20000711/xmldsig-core-schema.xsd:148:
> 11: Error: declaration with 'type' attribute must not have nested type
> declaration
> 
>  <element name="RetrievalMethod">
>   <complexType content="elementOnly">
>    <sequence minOccurs="1" maxOccurs="1">
>      <element name="Location" type="uriReference" minOccurs="1"
> maxOccurs="1" /> 
>      <element name="Method" type="string" minOccurs="1" maxOccurs="1" /> 
>      <element ref="ds:Type" minOccurs="1" maxOccurs="1" /> 
>      </sequence>
>     <attribute name="Encoding" type="uriReference" use="optional" /> 
>    </complexType>
>   </element>
> 
>  <element name="Type" type="string">
>   <complexType content="mixed">
>    <any namespace="##any" minOccurs="1" maxOccurs="unbounded" /> 
>    <attribute name="Encoding" type="uriReference" use="optional" /> 
>    </complexType>
>   </element>
> 
The problem is that an element declaration cannot specify its type by BOTH a
type attribute and with an inline complexType definition (that is what is
meant by the error message "Error: declaration with 'type' attribute must
not have nested type declaration").

Thus, if you replace the element declaration for the element named "Type"
with the following:

   <element name="Type">
      <complexType content="mixed">
         <any namespace="##any" minOccurs="1" maxOccurs="unbounded" />
         <attribute name="Encoding" type="uriReference" use="optional" />
      </complexType>
   </element>

all will be fine.

pvb

Received on Monday, 10 July 2000 16:58:25 UTC