Parsing with a DTD

After the XML declaration, the document prolog can include a DTD, reference an external DTD, or both. In this section, you'll see the effect of the DTD on the data that the parser delivers to your application.

DTD's Effect on the Nonvalidating Parser

In this section, you'll use the Echo program to see how the data appears to the SAX parser when the data file references a DTD.

Note

The XML file used in this section is slideSample05.xml, which references slideshow1a.dtd. The output is shown in Echo07-05.txt. (The browsable versions are slideshow1a-dtd.html, slideSample05-xml.html, and Echo07-05.html.)

Running the Echo program on your latest version of slideSample.xml shows that many of the superfluous calls to the characters ...

Get The J2EE™ Tutorial Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.