<!ELEMENT Computer (Disk?)> means the Disk element can occur zero or once.
<!ELEMENT Computer (Disk+)> means the Disk element can occur one or more times.
<!ELEMENT Computer (Disk*)> means the Disk element can occur zero or more times.
<xs:element name="Disk" type="xs:string" minOccurs="1" maxOccurs="3"/>
Can we perform the same restriction in DTD? It's messy, but possible! Use the OR operator (|) to specify a choice between the amount of options.
<!ELEMENT DiskSection (Disk | (Disk,Disk) | (Disk,Disk,Disk))>
Of course, anything more than a few options and it becomes very messy!
This Definition of the content model is not deterministic.
ReplyDelete