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:
<?xml version="1.0"?>
<!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>
<!ATTLIST price
US CDATA #REQUIRED
>
]>
<books>
<book>
...
The IE vrowser just showed the XML file with first 2 lines:
<?xml version="1.0" ?>
<!DOCTYPE books (View Source for full doctype...)>
- <books>
- <book>
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:
<?xml version="1.0"?>
<!DOCTYPE books SYSTEM "http://www.wrox.com/DTDlibrary/books.dtd">
<books>
<book>
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?
TIA,
Jeffrey
C. Jeffrey Wang
|