Re: [xml-dev] Validation of missing elements in xml:

From
Eric van der Vlist <>
To
Date
2006-04-05T06:15:12Z
ID
<>
Thread
Re: [xml-dev] Validation of missing elements in xml:
Hi Mukul,

Le mardi 04 avril 2006 à 16:04 +0530, Mukul Gandhi a écrit :
> On 4/4/06, Mukul Gandhi <> wrote:
> 
> > <xs:simpleType name="mystring">
> >   <xs:restriction base="xs:string">
> >      <xs:minLength value="1"/>
> >      <xs:pattern value="[A-Za-z]{1,}&#x20;*[A-Za-z]{1,}"/>
> >   </xs:restriction>
> > </xs:simpleType>
> 
> Sorry, there is no need of <xs:minLength value="1"/>

I am not convinced that

<xs:simpleType name="mystring">
   <xs:restriction base="xs:string">
      <xs:pattern value="<<magic regular expression here>>"/>
   </xs:restriction>
</xs:simpleType>

could be considered better (or simpler) than:

<xs:simpleType name="mystring">
   <xs:restriction base="xs:token">
      <xs:minLength value="1"/>
   </xs:restriction>
</xs:simpleType>

If your regular expression was right, you could allow the same set of
text nodes but I don't really see the benefit...

Eric 

-- 
GPG-PGP: 2A528005
Lisez-moi sur XMLfr.
                       http://xmlfr.org/index/person/eric+van+der+vlist/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------