Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > BOOK: Beginning ASP 3.0
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 8th, 2005, 11:01 PM
Friend of Wrox
Points: 630, Level: 9
Points: 630, Level: 9 Points: 630, Level: 9 Points: 630, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Austin, TX, USA.
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
  #2 (permalink)  
Old November 9th, 2005, 03:54 PM
Friend of Wrox
Points: 630, Level: 9
Points: 630, Level: 9 Points: 630, Level: 9 Points: 630, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Austin, TX, USA.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:41 PM.


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