Grouping Elements
May 3, 1999
Children can be grouped using parentheses. Thus, the following
DTD snippet would specify that a CONTACT element could have one
or more sets of NAME/EMAIL children such that NAME always
precedes EMAIL.
<!ELEMENT CONTACT (NAME, EMAIL)+>
<!ELEMENT NAME (#PCDATA)>
<!ELEMENT EMAIL (#PCDATA)>
That would look something like the following:
<CONTACT>
<NAME>Jim Sanger</NAME>
<EMAIL>sanger@sanger.com</EMAIL>
<NAME>James Sanger</NAME>
<EMAIL>james.sanger@sanger.com</EMAIL>
<NAME>Kris Kringle</NAME>
<EMAIL>santa@sanger.com</EMAIL>
</CONTACT>
Repeated Elements
Introduction to XML For Web Developers | Table of Contents
Either/Or
|