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

Re: 'base' in 'restriction'

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 07 May 2001 13:10:41 +0100
To: sandygao@ca.ibm.com
Cc: www-xml-schema-comments@w3.org
Message-ID: <f5bitjdnyv2.fsf@cogsci.ed.ac.uk>
sandygao@ca.ibm.com writes:

> I think there is an inconsistency in the structure spec
> (http://www.w3.org/TR/xmlschema-1). According to 3.4.2, 'restriction' can
> have a child element 'simpleType', in which case, the 'base' attribute in
> 'restriction' should be omitted. But in appendix A "Schema for Schemas",
> 'base' is always 'required' for 'restriction'.
> My opinion is that 'base' should be 'optional' for 'restriction'.

Note there are _three_ <restriction> elements -- child of
<simpleType>, child of <simpleContent> and child of
<complexContent>/<complexType>.  The first, documented at [1], is the
one which has a forced choice between a 'base' attribute and a
<simpleType> child.

The second and third, which appear in [2] in section 3.4.2, are
different.  They both _require_ a 'base' attribute, but the
<simpleContent> case also _allows_ a <simpleType> child, for the case
where a complexType with simpleContent is restricting another
complexType with simpleContent-- the <restriction>'s base must
reference the complexType, while the <simpleType> child must itself
restrict the base's content type.  Tricky, but when you need it you'll 
understand it.


[1] http://www.w3.org/TR/xmlschema-2/#element-restriction
[2] http://www.w3.org/TR/xmlschema-1/
  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 Monday, 7 May 2001 08:10:48 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:56 UTC