University of Cincinnati logo and link  
DTD ELEMENT Rules
 
  UC ingot
  • The ELEMENT tag specifies the children that an element can have.
    • For our simple XML file, we can state that element database has children drivername and databaseURL by putting the children in parenthesis, separated by commas.

    • <!ELEMENT database (drivername, databaseURL)>
    • Then we can follow that with ELEMENT tags for the child tags, along with #PCDATA to specify that they contain text.  PCDATA stands for parsed character data.

    • <!ELEMENT drivername (#PCDATA)>
      <!ELEMENT databaseURL (#PCDATA)>
    • You can use regular expressions to describe the children in more detail.  But we don't need that for our simple XML file.  If you're interested, see pages 1131-1132 of the book.
  • XML Schema Definition (XSD) allows us to be more specific about the type of data the element contains, such as integer, string, etc.  This is a newer feature, though, and one we will not explore.
 DTD ATTRIBUTE Rules