Re: Codelists: restricting simpleContent complexTypes

On Wed, 2002-10-16 at 09:36, Simon.Cox@csiro.au wrote:

>   <complexType name="CodeType">
>     <simpleContent>
>       <extension base="string">
>         <attribute name="codeSpace" type="anyURI" use="optional"/>
>       </extension>
>     </simpleContent>
>   </complexType>

>   <element name="name" type="my:CodeType"/>
>   <complexType name="ISOCountry2CharType">
>     <simpleContent>
>       <restriction base="my:CodeType">
[...]
>         <attribute name="codeSpace"
> fixed="http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-li
> sts/list-en1-semic.txt" use="optional"/>
>       </restriction>
>     </simpleContent>
>   </complexType>
 
> 
> Microsoft's online .NET validator
> http://www.gotdotnet.com/services/xsdvalidator/Default.aspx says the
> attribute restrictions are invalid.  Why?? How can I fix it?

Add:

	type="anyURI" 

to the re-definition of the attribute.  When redefining the attribute,
the base type must be derived from or equal to the base type of the
attribute it is redefining.

IBM's sqc is very good at finding problems with schemas, and explaining
what the problem actually is.

cheers,

Paul
-- 
Paul Warren, Client Services           DecisionSoft Limited
+44-1865-203192                        http://www.decisionsoft.com

Received on Wednesday, 16 October 2002 05:02:45 UTC