Parsing a Parameterized DTD

This section uses the Echo program to see what happens when you reference xhtml.dtd in slideshow2.dtd. It also covers the kinds of warnings that are generated by the SAX parser when a DTD is present.

Note

The XML file used here is slideSample08.xml, which references slideshow2.dtd. The output is contained in Echo10-08.txt. (The browsable versions are slideSample08-xml.html, slideshow2-dtd.html, and Echo10-08.html.)

When you try to echo the slide presentation, you will find that it now contains a new error. The relevant part of the output is shown here (formatted for readability):

 <?xml version='1.0' encoding='UTF-8'?> ** Parsing error, line 22, uri: .../slideshow.dtd Element type "title" must not be declared more ...

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.