W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

Re: [Fwd: XML Schema Part 2 should provide BNF for all primitive types.]

From: Kohsuke KAWAGUCHI <k-kawa@bigfoot.com>
Date: Thu, 29 Mar 2001 12:55:39 -0800
To: Alexander Falk <al@altova.com>
Cc: w3c-xml-schema-ig@w3.org, www-xml-schema-comments@w3.org
Message-Id: <20010329123904.6740.K-KAWA@bigfoot.com>

I really appreciate WG members and James Clark who picked up my grief.
I'm looking forward to see these BNF/RegExp in the spec.

I suggests use of BNF rather than RegExp. RegExp is good for
"approximation", but when it comes to precise definition, RegExp tends
to become longer and thus illegible. Illegible expression is also
difficult to check by humans.

For example, in "duration" type, any component can be omitted as long as
at least one is present. And 'T' must be present if and only if one of
H,M,S is present.

It's impractical to precisely express this constraint by using RegExp.

Y M? D? (T (H M? S?) | (M S?) | S )? |
M  D? (T (H M? S?) | (M S?) | S )? |
D (T (H M? S?) | (M S?) | S )? |
T H M? S? |
T M S? |
T S

BNF is more legible.

duration := <YMDPart> T <HMSPart>
duration := <YMDPart>
duration := T <HMSPart>

YMDPart := Y M? D?
YMDPart := M D?
YMDPart := D

HMSPart := H M? S?
HMSPart := M S?
HMSPart := S

regards,
----------------------
K.Kawaguchi
E-Mail: k-kawa@bigfoot.com
Received on Thursday, 29 March 2001 15:55:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:50 GMT