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

Re: Codelists: restricting simpleContent complexTypes

From: Paul Warren <pdw@decisionsoft.com>
Date: 16 Oct 2002 10:02:34 +0100
To: Simon.Cox@csiro.au
Cc: xmlschema-dev@w3.org
Message-Id: <1034758954.2478.199.camel@tobol.dsl.local>

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 GMT

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