RE: Invalid per cvc-complex-type.1.3: undeclared attribute {None}:use

> -----Original Message-----
> From: Svend Bent Nielsen [mailto:jawsoap@hotmail.com] 
> Sent: Thu, Oct 23, 2003 06:23
> To: xmlschema-dev@w3.org
> 
> Using http://www.w3.org/2001/03/webdata/xsv for checking my 
> schemas, I get the following error "Invalid per 
> cvc-complex-type.1.3: undeclared attribute {None}:use" with a 
> link to the (I think) relevant part of the documentation.
> 
> <?xml version="1.0"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema">
> 	<element name="A">
> 		<complexType>
> 			<all>
> 				<element ref="B"/>
> 			</all>
> 			<attribute ref="TestAtt"/>
> 		</complexType>
> 	</element>
> 	<element name="B">
> 		<complexType>
> 			<attribute ref="TestAtt"/>
> 		</complexType>
> 	</element>
> 	<attribute name="TestAtt" use="required">
> 		<simpleType>
> 			<restriction base="positiveInteger">
> 				<enumeration value="1"/>
> 				<enumeration value="2"/>
> 			</restriction>
> 		</simpleType>
> 	</attribute>
> </schema>

The problem is that top-level attribute declarations are not allowed to to have a use attribute.  Instead, your schema should look like:

<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
   <element name="A">
      <complexType>
         <all>
            <element ref="B"/>
         </all>
         <attribute ref="TestAtt" use="required"/>
      </complexType>
   </element>
   <element name="B">
      <complexType>
         <attribute ref="TestAtt" use="required"/>
      </complexType>
   </element>
   <attribute name="TestAtt">
      <simpleType>
         <restriction base="positiveInteger">
            <enumeration value="1"/>
            <enumeration value="2"/>
         </restriction>
      </simpleType>
   </attribute>
</schema>

pvb

Received on Thursday, 23 October 2003 11:51:57 UTC