W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2000

Re: restrictions with nested simpleTypes.

From: Martin Gudgin <marting@develop.com>
Date: Sun, 10 Dec 2000 19:40:57 -0800
Message-ID: <003c01c06324$2cde42f0$d839f940@greyarea>
To: "Jason Diamond" <jason@injektilo.org>, <xmlschema-dev@w3.org>
Hi Jason,

Because maybe you don't want to expose the inner type to the outside
world... If it only gets used in one context then it makes sense to 'hide'
it like this.

FWIW the Schema-for-schemas uses this technique for the type of maxOccurs;

<simpleType name="allNNI">
  <annotation><documentation xml:lang="en">
   for maxOccurs</documentation></annotation>
  <union memberTypes="nonNegativeInteger">
    <restriction base="NMTOKEN">
     <enumeration value="unbounded"/>

Or is your question about having a restriction within a restriction? If so
then I can't of the top of my head think of a situation where you would
*need* to do it that way. The syntax allows it but

<xsd:simpleType name='fooType'>
      <xsd:restriction base='xsd:string'>
        <xsd:minLength value='6' />

would have the same value space and lexical space as;

<xsd:simpleType name='fooType'>
  <xsd:restriction base='xsd:string'>
    <xsd:minLength value='6' />

although at the component level they would look slightly different.


----- Original Message -----
From: "Jason Diamond" <jason@injektilo.org>
To: <xmlschema-dev@w3.org>
Sent: Sunday, December 10, 2000 6:58 PM
Subject: restrictions with nested simpleTypes.

> I don't understand why the base attribute isn't good enough. Why would you
> ever do this?
> <xsd:simpleType name="fooType">
>   <xsd:restriction>
>     <xsd:simpleType>
>       <xsd:restriction base="xsd:string">
>         <!-- ... -->
>       </xsd:restriction>
>     </xsd:simpleType>
>     <!-- ... -->
>   </xsd:restriction>
> </xsd:simpleType>
> Thanks,
> Jason.
Received on Sunday, 10 December 2000 22:42:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:48 UTC