Followed the Page 841 Errata for the Book:
841 External DTD needs lines removing from it
The error was supplied by Barry Godsmark.
The '>' is missing from end of second line of DTD example.
The first and last lines of this example DTD should be omitted in an external DTD file.
This text works ok when included directly in the xml file but fails when used as an external DTD. Refer page 451 of Professional ASP 3.0.
First, I add the DTD text in my BooksDTD.xml file:
<!DOCTYPE books [
<!ELEMENT books (book+)>
<!ELEMENT book (title, ISBN, authors, description?, price+)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT authors (author+)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT price EMPTY>
US CDATA #REQUIRED
The IE vrowser just showed the XML file with first 2 lines:
<?xml version="1.0" ?>
<!DOCTYPE books (View Source for full doctype...)>
Apparently the DTD did not work.
I also tried the external DTD file. Added the '>' to the end of second line and deleted the first and last lines. The browser shoed the same XML file, not the book information.
I tried http DTD address:
<!DOCTYPE books SYSTEM "http://www.wrox.com/DTDlibrary/books.dtd">
The browser showed the error:
The system cannot locate the object specified. Error processing resource 'http://www.wrox.com/DTDlibrary/books.dtd'.
All I have done successfully was using the books.css.
What's wrong with the DTD file?
C. Jeffrey Wang