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

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 UTC