Re: Codelists: restricting simpleContent complexTypes

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 UTC