Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 8th, 2005, 11:01 PM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 124
Thanks: 0
Thanked 1 Time in 1 Post
Default Chap 18 XML,error: multiple DOCTYPE declarations

I wrote a books.dtd file as shown on P. 841 and saved it at the same directory as my XML document. Then I added a document type declaration to the books.xml file:
<?xml version="1.0"?>
<!DOCTYPE books SYSTEM "books.dtd">
<books>
<book>
....

Opened the books.xml in my IE browser, showed the following error message:

Cannot have multiple DOCTYPE declarations. Error processing resource 'http://localhost/xml/books.dtd'. Line 1, Position 11

<!DOCTYPE books [
----------^


What's wrong?

TIA,
Jeffret


C. Jeffrey Wang
__________________
C. Jeffrey Wang
 
Old November 9th, 2005, 03:54 PM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 124
Thanks: 0
Thanked 1 Time in 1 Post
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying DOCTYPE in input to the output xml mrame XSLT 3 July 31st, 2008 04:26 PM
chap 18, p591 problem deanbrown BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 4 June 10th, 2008 12:36 AM
Linker Error, Chapter 18 Spasticus BOOK: Ivor Horton's Beginning Visual C++ 2005 4 February 20th, 2008 05:04 AM
Chap 03 Try It Out -- Error Doug Happ BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 February 11th, 2008 02:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.