• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 25. XML > XML and DTDs

XML and DTDs

Using elements

Elements in a DTD are similar to fields in a database. The more specific the fields are, the more specific will be the content they contain, and the more varied the ways the content can be extracted and organized, depending on the desired output medium (print or Web).

For comparison, think of a mail merge function, where each line of an address is defined as an individual element. Rearranging the elements would alter how the individual lines of the address could be displayed. Specified lines of the address could be used in an output document (say, using just names and business titles) without using the remaining lines of the address. In the case of XML, all the rearranging and reorganizing is controlled by selectively choosing which elements will be in the XML file.


A DTD (short for “document type definition”) is a plain text file that's created using a simple text editor. A DTD specifies which elements will be in an XML file, the kind of information that can be put into an element, the order of the elements in the XML file, and which elements can contain subelements (nested elements). Although a DTD isn't required for creating XML files, it helps control the relationships among elements and helps keep elements consistent between different XML files. QuarkXPress's implementation of XML requires a DTD file.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint