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

Re: attribute use="prohibited"

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 21 Feb 2001 16:13:52 +0000
To: "Bob Schloss" <rschloss@us.ibm.com>
Cc: xMLSchema-dev@w3.org
Message-ID: <f5bu25oau9r.fsf@cogsci.ed.ac.uk>
"Bob Schloss" <rschloss@us.ibm.com> writes:

> 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,

Well, you can use it elsewhere, but it's sort of pointless -- it just
disappears with no effect.

> and <anyAttribute> in the base definition of the complexType or in
> an extension, if you do not specify namespace.

No, you can use it in a restriction as well, as long as there's one in 
the base and it has no namespace either.

> Therefore, if the <anyAttribute> occurs later in the type
> deriviation chain, even "foo" will be legal.

Yes.

> If the <attribute use="prohibited"> occurs later in the type
> derivation chain, foo will not be legal.

Nope -- the wildcard comes through unchanged.  'prohibited' is _only_
there to allow you to retract an optional attribute higher up the chain.

> 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.

You can.

> 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>

Same story -- no bug, clarification that this is the case should be
added to the spec.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Wednesday, 21 February 2001 11:13:58 UTC

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