W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2001

Re: attribute use="prohibited"

From: Bob Schloss <rschloss@us.ibm.com>
Date: Wed, 21 Feb 2001 08:57:54 -0500
To: xMLSchema-dev@w3.org
Message-ID: <OFB20B4400.5E2C0CE0-ON852569FA.004BCEDB@pok.ibm.com>
Michael Anderson asks:
> what will be the behaviour for the following definition:
> <complexType>
>   <attribute name="foo" use="prohibited"/>
>   <anyAttribute/>
> </complexType>

I think one can only use <attribute ... use="prohibited"/> in a
restriction,
and <anyAttribute> in the base definition of the complexType or in an
extension,
if you do not specify namespace.
Therefore, if the <anyAttribute> occurs later in the type deriviation
chain,
even "foo" will be legal.  If the <attribute use="prohibited"> occurs later
in the
type derivation chain, foo will not be legal.  I do not think you can
specify
both the <anyAttribute> without namespace and the <attribute .. use
="prohibited"> at the same
level of the type derivation hierarchy.

However, the question still remains, what if this is a restriction, the
base complexType had anyAttribute with no namespace, and this type is
<complexType name="derivedType">
 <complexContent>
   <restriction base="baseType">
      ...
    </restriction>
    <attribute name="foo" use="prohibited"/>
    <anyAttribute namespace="##targetNamespace"/>
 </complexContent>
</complexType>

Bob Schloss
Received on Wednesday, 21 February 2001 08:58:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:51 UTC