16. DTD for Elements with Either/Or Elements

Elements having either/or elements can be defined. The "|" sign is used to declare that an element must contain either/or elements.

Example 16.1 An Element Having Either/Or
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE rootelement [
<!ELEMENT rootelement (childelement1|childelement2)>
<!ELEMENT childelement1 (#PCDATA)>
<!ELEMENT childelement2 (#PCDATA)>
]>
<rootelement>
	<childelement2>Child element 2.</childelement2>
</rootelement>