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

Chapter 37. Toward XML > Understanding XML Structure

Understanding XML Structure

XML is actually two languages, or meta-languages really, both described in the same document. The first is a set of rules for producing well-formed XML documents whereas the second is a set of rules for producing an XML Document Type Definition, or DTD, which allows the structure of the XML document to be constrained and validated against those constraints. The distinction between these two languages is often blurred, because a complete XML document includes at least the optional presence of a DTD, whether it's actually present or not. To complicate things further, the DTD might consist of two parts, an internal subset and an external subset.

This chapter looks at the XML document without dwelling too much on the DTD, because it's possible to create an XML document without reference to a DTD. For performance reasons, many XML documents will be used without ever validating against the DTD, even if the DTD is available. Over slow connections, reading in a DTD located external to your local machine might be tediously slow, and because DTDs might contain references to other documents, resolving all the external references might take an inordinate amount of time even with a high speed connection. Users are accustomed to seeing HTML documents load incrementally, so they can be read before the document finishes loading, but validating XML parsers aren't allowed to display the document unless it's valid, so the document won't appear on the user's screen until everything is loaded. This can be disconcerting.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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