Online Resources
for the classes of
Paul Roberts

XML • Frequently Asked Questions

Students have questions about the slippery behemoth XML. Since it requires more than one type of file, it may help to answer questions for everyone's benefit. Look for additions to this FAQ as questions arise.

  1. Please explain the purpose and function of the DTD. Is it supposed to do something?
  2. The DTD doesn't make any difference in the visual presentation of the XML. It is the rule book for the XML markup. It sets on the rules on the order of the elements, the of occurrences the element may have, whether it's required or optional,whether they are containers for child elements or containers for text. The DTD also sets the rules for attributes.
  3. While it may not make sense to have a DTD for a single use of the XML vocabulary, it is essential for multiple uses, such as MathML or the one that is used in our department, WWML. The validation file requires that the vocabulary be used as intended.
  4. After reading about the use of signs ( ? + * | ) in the element declarations of the DTD, I am confused about when to use them. Since the asterist ( * ) directs zero or more occurrences and most or all of elements occur more than once, do you put the asterisk symbol in the DTD file on all elements just to play it safe?
  5. Check out the Handouts Collection at Eagle Online for a handout with an explanation of the element declarations in the DTD. As for when to use each one, it's self-explanatory. If an element within an element cluster is intended to occur once and only once, don't use a sign. If it doesn't matter if the element doesn't occur at all or if it occurs a thousand+ times, use the asterisk ( * ). The question mark means it doesn't have to occur at all, but if it does it must occur only once. Look at the table on the handout for further help.
spacer