Home > Articles > Web Services > XML

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

14.2 | A Simple DTD for E-mail

Before going any further with parsing Linux or Eudora mailboxes, we need to settle on an XML representation of a mailbox. We will use the following simple DTD.

CD-ROM reference=14003.txt
XMail = A simple DTD for a collection of e-mail messages

An xMail file consists of zero or more message elements.

A message has a headers element that contains fields such as
from, to, subject, and so on. The body element houses
the text of the e-mail

<!ELEMENT xmail   (message)*>
<!ELEMENT message (headers,body)>
<!ELEMENT headers (field)+>
<!ELEMENT field   (name,value)>
<!ELEMENT name    (#PCDATA)>
<!ELEMENT value   (#PCDATA)>
<!ELEMENT body    (#PCDATA)>
  • + Share This
  • 🔖 Save To Your Account