← Prev in month ← Prev in thread
Next in thread → Next in month →

Container generation for 0 .. n elements

From
Dan Vint <>
Date
2003-06-04T15:59:41+00:00
ID
Thread
Container generation for 0 .. n elements
The current rule is for 1 to many:

Address  1 or more

Would have the following:

AddressList	1
	Address	1 or more

In DTDs this would be:

<!ELEMENT AddressList (Address)+ >

And where ever Address was used parent items will now use AddressList and 
it will be a required element.

The primary "problem" that was documented in the minutes was that the rule 
as proposed would potentially cause an EMPTY element if the container is 
required and the contents remain optional.  To handle this, but still have 
the same positive results of using containers, the 0 to many, the rule 
would be modified as follows:

1) Create a container with elementnameList and make it 0 or 1
2) Content of the container cardinality would be changed to 1 or more

So if I have the following:

Children	0 or more

and

Parent contains Children

I would propose this

ChildrenList	0 or 1
	Children	1 or more

So we would have this:

<!ELEMENT ChildrenList	(Children+) >
<!ELEMENT Parent	(a, ChildrenList?, b) >

This design, still allows a Parent to not have any Children, because the 
container is optional, but if the container is used, then there has to be 
at least one Children element sent. The end result is that Children is 
optional repeating in the data stream.

..dan
← Prev in month ← Prev in thread
Next in thread → Next in month →