[relaxng-user] RNC and repeatedPrimary

Jeff Rafter lists at jeffrafter.com
Fri May 7 09:29:25 ICT 2004


Everywhere I look I see this kind of construction (which may be the answer
to the question I am about to ask), but I have always wondered why the *, +,
? operators are at the end of constructions. Wouldn't it make more sense for
them to be at the start of a construction? For example:

    foo =  element foo { (bar1, bar2, bar3+, bar4)* }

could just as easily be:

    foo =  element foo { *(bar1, bar2, +bar3, bar4) }

Especially in the case of RNC, where a repeatedPrimary is wrapped in
something like <zeroOrMore>x</zeroOrMore> this makes sense, as it allows
parsers/producers to be written in a streaming mode.

I am sure there is a good reason, I am sure I am missing something obvious-- 
I have just always wondered.

Thanks,
Jeff Rafter



More information about the relaxng-user mailing list