Re: final=""

Stanley Guan <stanley.guan@oracle.com> writes:

> Hi,
> 
> Is empty string an allowed value for attribute "final" as shown
> below?
> 
>  <xsd:element name="fe_valid" final="" type="tns:sd"/>
> 
> XSV seems to take it o.k.  But, as shown in the spec.:
>   <element
>     (snip)
>     final = (#all | List of (extension | restriction))
>     (snip)
>   </element>
> 
> Does this mean the only acceptable values for attribute
> "final" are:
>   "#all",
>   "extension", or
>   "restriction"?

The tableaux are non-normative, but are derived from the sForS, which
is the normative reference here:

  <xs:union>
   <xs:simpleType>    
    <xs:restriction base="xs:token">
     <xs:enumeration value="#all"/>
    </xs:restriction>
   </xs:simpleType>
   <xs:simpleType>
    <xs:list itemType="xs:reducedDerivationControl"/>
   </xs:simpleType>
  </xs:union>

 <xs:simpleType name="reducedDerivationControl">
  <xs:restriction base="xs:derivationControl">
   <xs:enumeration value="extension"/>
   <xs:enumeration value="restriction"/>
  </xs:restriction>
 </xs:simpleType>

So in fact all the following are allowed:

final="#all"        (first branch of the union)
final=""            (2nd branch of the union, length 0)
final="extension"   (2nd branch of the union, length 1)
final="restriction" (2nd branch of the union, length 1)
final="extension restriction"   (2nd branch of the union, length 2)

and a bunch of useless variations are also allowed

final="restriction extension" (2nd branch of the union, length 2)
final="restriction restriction" (2nd branch of the union, length 2)
final="extension extension" (2nd branch of the union, length 2)
final="restriction extension restriction" (2nd branch of the union, length 3)

We could/probably should have restricted the length to two, but that
still would have left some redundancy.  Doesn't matter to the
semantics.

If you read the relevant mapping prose for {substitution group
exclusions} in 3.3.2 [1] you will see that the length 0 list is
entirely reasonable, is in fact the default (via the 'finalDefault'
attribute on <xs:schema>), and means that the element's use as a
substitution group head is not constrained.

ht

[1] http://www.w3.org/TR/xmlschema-1/#declare-element
-- 
  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, 27 February 2002 04:07:15 UTC