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 14:05:08 +0200 (MEST)
To: Jeni Tennison <jeni@jenitennison.com>; xmlschema-dev@w3.org
Message-ID: <30356.1034769908@www59.gmx.net>

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 GMT

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