W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2002

Re: Regular expressions

From: <noah_mendelsohn@us.ibm.com>
Date: Thu, 8 Aug 2002 23:35:12 -0400
To: Michael Nahas <mike_nahas@yahoo.com> (by way of "C. M. Sperberg-McQueen" <<mike_nahas@yahoo.com<mike_nahas>)
Cc: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
Message-ID: <OF87E974A8.2CABFC3B-ON85256C0F.005FACB7@lotus.com>

Except for the syntax, schema content models are essentially regular 
expressions over element names:

(A|B) ==> <xsd:choice>
(A,B) ==> <xsd:sequence>
A* = <element ref="A" minOccurs="0" maxOccurs="unbounded"/>
A+= <element ref="A" minOccurs="1" maxOccurs="unbounded"/>
(A|B)* ==> <xsd:choice minOccurs="0" maxOccurs="unbounded">

This is not an accident.  Schemas are designed as regular expressions, and 
have a heritage in DTDs, which are regular expressions.  The schema WG 
considered the Kleene operators (e.g. *, +) and decided instead on on the 
syntax you see above.   So, I think schemas already have the function that 
you are requesting.  Thank you.

Noah Mendelsohn                              Voice: 1-617-693-4036
IBM Corporation                                Fax: 1-617-693-8676
One Rogers Street
Cambridge, MA 02142

Michael Nahas <mike_nahas@yahoo.com> (by way of "C. M. Sperberg-McQueen" 
Sent by: www-xml-schema-comments-request@w3.org
07/29/2002 05:59 PM

        To:     W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
        cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        Regular expressions

Sir or Madam:
                 I'd like if the next XML Schema spec had a clear 
relationship to regular 
expressions. I (and a lot of other people) know and understand regular 
expressions.  They're well known by the parsing community.  So, I'd love 
if the new spec contained things that had a relationship to +, *, ?, |, 
().  I suggest tag names of"atLeastOne" "anyNumber" "optionally", 
"chooseOne", and "grouping".
                 So you might end up with something like this:

<element name="element">
                                 <element name="isOfType>
                                                 <attribute name="type" 
  <attribute name="type" value="string">
  <attribute name="name" value="string">
  <attribute name="value" value="string>
  <attribute name="name" value="string">

                 I think it is much cleaner than what is currently being 
used in schemas.

                 Michael Nahas
Received on Thursday, 8 August 2002 23:36:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:00 UTC