W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2003

Re: <simpleType> inside <restriction>

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: Tue, 19 Aug 2003 09:41:15 +0100
To: marktt@excite.com
Cc: xmlschema-dev@w3.org
Message-ID: <f5br83im444.fsf@erasmus.inf.ed.ac.uk>

"Mark Thomson" <marktt@excite.com> writes:

> Hi,
>
> Can any one tell me why <simpleType> is among the children of
> <restriction> when <restriction> is a child of <simpleContent>
> (Section 3.4.2 in Part 1)? The required base attribute of
> <restriction> specifies the base type which is being restricted. I
> can't understand why there is an optional <simpleType> after the
> <annotation>?

Consider what's involved here -- you have a complex base type def'n,
which itself has simple content.  Suppose that simple content is of
type xs:decimal.  Now you want a new complex type def'n, restricting
that one, with simple content xs:integer.  You need to point to _two_
def'ns.  So you do

<xs:complexType name="derived">
 <xs:simpleContent>
  <xs:restriction base="my:base">
   <xs:simpleType>
    <xs:restriction base="xs:integer">
      . . .
    </xs:restriction>
   </xs:simpleType>
  </xs:restriction>
 </xs:simpleContent>
</xs:complexType>

Hope this helps.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-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/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Tuesday, 19 August 2003 04:41:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:39 GMT