Re: Codelists: restricting simpleContent complexTypes

Hi Jeni,

thanks for the clarification. I changed my code.

--Stefan

PS: Is it allowed to first prohibit an attribute and to introduce it again
later? The spec. says that attribute declarations with use="prohibited" are
nothing at all. This suggests that a type does not know if an attribute is
prohibited or simply not present. Therefore adding an attribute after it was
prohibited should be allowed. Sounds strange, doesn't it?

> 
> Hi Stefan,
> 
> > 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.
> 
> No, I don't think that it does. When you define a new complex type by
> restriction, you either inherit the entire attribute use or you don't
> inherit it at all (in which case there may be a replacement attribute
> use defined in the derived type).
> 
> > 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">
> 
> Ah, but that's different. All this is doing is *prohibiting* the
> (whole) attribute use, preventing it from being inherited from the
> base type and hence omitting it from the derived type.
> 
> Cheers,
> 
> Jeni
> 
> ---
> Jeni Tennison
> http://www.jenitennison.com/
> 

Received on Wednesday, 16 October 2002 08:05:44 UTC