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

RE: restrictions with nested simpleTypes.

From: Jason Diamond <jason@injektilo.org>
Date: Sun, 10 Dec 2000 20:04:36 -0800
To: "Martin Gudgin" <marting@develop.com>, <xmlschema-dev@w3.org>
Message-ID: <LAEMKGDBDFAKFNKPFEKLGECACPAA.jason@injektilo.org>
Thanks, Martin.

That makes perfect sense. So far, I've only implemented restrictions for
simpleTypes in my schema parser. So the only example I could test was a
nested restriction which didn't strike me as being at all useful.

Jason.

> -----Original Message-----
> From: xmlschema-dev-request@w3.org
> [mailto:xmlschema-dev-request@w3.org]On Behalf Of Martin Gudgin
> Sent: Sunday, December 10, 2000 7:41 PM
> To: Jason Diamond; xmlschema-dev@w3.org
> Subject: Re: restrictions with nested simpleTypes.
>
>
> 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">
>    <simpleType>
>     <restriction base="NMTOKEN">
>      <enumeration value="unbounded"/>
>     </restriction>
>    </simpleType>
>   </union>
>  </simpleType>
>
> 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>
>     <xsd:simpleType>
>       <xsd:restriction base='xsd:string'>
>         <xsd:minLength value='6' />
>       </xsd:restriction>
>     </xsd:simpleType>
>   </xsd:restriction>
> </xsd:simpleType>
>
> would have the same value space and lexical space as;
>
> <xsd:simpleType name='fooType'>
>   <xsd:restriction base='xsd:string'>
>     <xsd:minLength value='6' />
>   </xsd:restriction>
> </xsd:simpleType>
>
> although at the component level they would look slightly different.
>
> Gudge
>
> ----- 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 23:09:19 GMT

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