(
open bracket for grouping
)
close bracket
,
follows
|
or
?
maybe
*
repeated 0 or more times
+
repeated once or more times
What to watch out for:
<!ELEMENT a - - ((b, c)|(b, d))>
carriage return = record end (RE)
In the DTD:
<!ELEMENT listitem - - (#PCDATA, para+)> <!ELEMENT para - - (#PCDATA)>
In the document:
<listitem> Oranges <para>Oranges are a lovely fruit.</para> <para>They grow in warm climates.</para> </listitem>
Some further twists:
<!ELEMENT poem - O (title?, ( (line+) | (refrain?, (stanza, refrain?)+ ) ))>
<!ELEMENT (note | variant) - - (#PCDATA)>
<!ELEMENT poemref - O EMPTY >
<!ELEMENT memo - - ANY>
<!ELEMENT poem - O (title?, (stanza+ | couplet+ | line+)) +(note | variant) > <!ELEMENT title - O (#PCDATA) -(note | variant) > <!ELEMENT (note | variant) - - (#PCDATA) -(note | variant) >