W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

attribute declration's use property and restriction

From: Aki Yoshida <akitoshi.yoshida@sap.com>
Date: Thu, 11 Jan 2001 17:04:54 +0100
Message-ID: <000701c07be8$3d288a30$e968120a@wdf.sapag.de>
To: <www-xml-schema-comments@w3.org>
It seems something is under-specified regarding this or there is a bug in
the schema for schema.

Currently, when a complex type is created by restricting another complex
type that has attribute declarations (but no wildcard attributes), its
attribute-use-pair consists of those attributes declared only in the base
type and those re-declared in the derived type with having the same names
that are in use in the base type.  The spec doesn't clearly say how the
"use" property interacts with this derivation process and there is a
confusion.

Using a concrete example, type "facet" has a required attribute "value" with
no type constraint. Type "numFacet" restricts this type and gives a type
constraint for this attribute.  But the "use" attribute is not present in
that declaration.  The default value of "use" is optional and it seems to
conflict with the restriction constraints.  Is this a bug in the schema for
schema (i.e. use="required" is missing in the declaration) or are we
assuming some notational convenience (i.e. the name attribute identifies the
attribute and the base properties such as "use" are implicitly inherited to
the derived type?)

<complexType name="facet">
  <complexContent>
    <extension base="annotated">
       <attribute name="value" use="required"/>
       ...
   </extension>
 </complexContent>
</complexType>

<complexType name="numFacet">
   <complexContent>
      <restriction base="facet">
         ...
         <attribute name="value" type="nonNegativeInteger"/>
      </restriction>
  </complexContent>
</complexType>

If you allow me, I have one more quesiton with attribute declarations. If
someone could point me to the answer, that would be helpful.

Structure 1 (4.3.1) says, when the value attribute is present, it's not
allowed to have the use attribute with value other than default or fixed.
Primer, however, has an example to contradict this in its Table 1.  In the
component level, its possible to represent them (i.e. "required" is mapped
to "fixed" and its boolean set to 1 instead of 0).  Also it's uncluear if
this value="..." and use="required" thing can happen over type derivation.
For example,
<attribute name="x" use="required"/> can be restricted  by having value="1"?
or
<attribute name="x" use="default or fixed" value="1"/> can be restricted by
having use="required"?

Thanks.
Aki
Received on Thursday, 11 January 2001 11:17:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:49 GMT