Re: <simpleType> inside <restriction>

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