An !ELEMENT DTD declaration is a way to specify DTD constraints for an XML Element.


Single Elements

<!ELEMENT name (#CDATA)>  

A DTD schema for an XML element name with CDATA.

<!ELEMENT coordinates (x,y) #REQUIRED>  
<!ELEMENT x (#CDATA)>  
<!ELEMENT y (#CDATA)>  

A DTD schema for an XML element coordinates which must have the x and y elements inside


Multiple Elements

<!ELEMENT seats (seat+)>  

A DTD schema for an XML element seats which can have at least one seat as a child

<!ELEMENT seats (seat*)>  

A DTD schema for an XML element seats which can have any amount of seat elements - i.e. , and are all valid examples.

<!ELEMENT seats (seat?)>  

A DTD schema for an XML element seats which can have either or child(ren).


Union Elements

<!ELEMENT phone (android|iphone)>  

A DTD schema for an XML element phone which can have either android or iphone as it’s child.