minOccur,maxOccur

I know this is probably dredging up old stuff, but.  My initial reaction on
the minOccur, maxOccur was to side with the anti-minOccur/maxOccur comments.
However, I'm starting to lean the other way and see a lot of usefulness to
the minOccur, maxOccur formulation.

First, if we wan't to initially support only the DTD's level of validation,
minOccur could be restricted to (0|1) and maxOccur could be restricted to
(1|*).  This would support all the current occurrence modes but allow the
minOccur/maxOccur form to be used to allow for future enhancement.

Another approach would be to allow the full range of values for
minOccur/maxOccur but only require the processor to validate the most
restrictive of the compatible DTD modes.  That is, minOccur="2" maxOccur="*"
would be validated as "+", etc.

However, for low values of minOccur/maxOccur, it easily maps into DTD
equivalents, so I can't see how it would be a bear to implement.

<elementType name="fred">
	<elementTypeRef name="A" minOccur="2" maxOccur="4"/>
</elementType>

could be expressed in DTD as

<!ELEMENT fred (A,A,A?,A?) >

and 

<elementType name="fred">
	<elementTypeRef name="A" minOccur="2" maxOccur="*"/>
</elementType>

as 

<!ELEMENT fred (A,A+) >

I know this gets silly as N gets large, but we could restrict minOccur to
between 0 and 9 and maxOccur between 1 and 9 and *.

Otherwise, people could kludge the 2-* form in the schema using

<elementType name="fred">
	<seq>
		<elementTypeRef name="A"/>
		<elementTypeRef name="A" occurs="ONEORMORE"/>
	</seq>
</elementType>

But when you add documentation elements, it is going to be awkward to
explain the formulation.

p.s. 
I can see how it would be a bear to implement, if you allowed something like

<choice minOccur=0 maxOccur=20">
	<elementType name="A" minOccur="0" maxOccur="10"/>
	<elementType name="B" minOccur="0" maxOccur="10"/>
</choice>

Where you are intending up to 20 elements from the choice, but at most 10 of
them can be A.  If that was what was intended, I could see how it would be a
bear to implement and see no value in it.

Received on Tuesday, 29 June 1999 20:40:56 UTC