>> English << | česky | Español | По-русски | Français | Italiano | Deutsch | MagyarZVON > Tutorials > DTD Tutorial
>> Example 5 << | Prev | Next | Contents


If an element name in DTD is followed by the question mark [?], this element can occur zero or one times.


The root element XXX can contain one element AAA followed by precisely one element BBB. Element BBB must be always present.:


Valid documentsTop

A valid document:

 <!DOCTYPE XXX SYSTEM "tutorial.dtd">

<XXX> <AAA/> <BBB/> </XXX>

Element AAA is not mandatory:

 <!DOCTYPE XXX SYSTEM "tutorial.dtd">

<XXX> <BBB/> </XXX>

Documents with errorsTop

Element BBB is missing:

 <!DOCTYPE XXX SYSTEM "tutorial.dtd">

<XXX> ___ </XXX>

Maximaly one AAA element can occur inside the document:

 <!DOCTYPE XXX SYSTEM "tutorial.dtd">

<XXX> <AAA/> <AAA/> <AAA/> <AAA/> <AAA/> <AAA/> <AAA/> <BBB/> </XXX>

Element BBB must follow element AAA:

 <!DOCTYPE XXX SYSTEM "tutorial.dtd">

<XXX> <BBB/> <AAA/> </XXX>