The pipe character is used to specify an "OR" operation. Thus, the
following DTD snippet would specify an XML document in which all CONTACT
elements would have a NAME child followed by either a PHONE or an EMAIL
element (but not both).
<!ELEMENT CONTACT (NAME, (PHONE | EMAIL))>
<!ELEMENT NAME (#PCDATA)>
<!ELEMENT EMAIL (#PCDATA)>
Note that XML regular expression matching is not a short circuited
system. OR's imply one or the other but not both and not neither. Is
that a tongue twister or what!?! Using examples to make my point,
here are several invalid XML snippets based on the DTD snippet above....
<CONTACT>
<NAME>Jim Sanger</NAME>
</CONTACT>
That is invalid because the DTD specified that every CONTACT must have
either a PHONE or an EMAIL. The above has neither.
<CONTACT>
<NAME>Jim Sanger</NAME>
<EMAIL>Jim Sanger</EMAIL>
<PHONE>Jim Sanger</PHONE>
</CONTACT>
This one is invalid because the contact has BOTH EMAIL and PHONE
children.
<CONTACT>
<EMAIL>Jim Sanger</EMAIL>
<NAME>Jim Sanger</NAME>
</CONTACT>
This one is wrong because NAME must appear before EMAIL or PHONE