RE: restrictions with nested simpleTypes.

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 UTC