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

Re: Codelists: restricting simpleContent complexTypes

From: Stefan Wachter <Stefan.Wachter@gmx.de>
Date: Wed, 16 Oct 2002 11:58:39 +0200 (MEST)
To: Paul Warren <pdw@decisionsoft.com>;Simon.Cox@csiro.au;xmlschema-dev@w3.org
Message-ID: <22259.1034762319@www59.gmx.net>

I thought that if no type is specified for a restricted attribute than the
type of the attribute in the base type is used. Unfortunately, I could not
find a definition in the XML specification saying this.

However, the schema for schemas makes frequent use of this copying
behaviour. For example in the definition of a local simple type it restricts the name
attribute by the following declaration:

        <xs:attribute name="name" use="prohibited">

Therefore I assume that copying the base type is the valid behaviour.

--Stefan


> 
> 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:58:43 GMT

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