This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Product and Other Certifications and the fly likes internal DTD override Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "internal DTD override" Watch "internal DTD override" New topic
Author

internal DTD override

Gobiraj Vadivelrajan
Greenhorn

Joined: Jun 05, 2002
Posts: 5
I have a external DTD and I wanted to override an element declaration using an internal DTD. When I try to open the XML using IE or XML Notepad I get
an error that the element is already declared.
DTD
<!ELEMENT catalog (book*)>
<!ELEMENT book (title,isbn,price)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT isbn (#PCDATA)>
<!ELEMENT price (#PCDATA)>
XML
<?xml version="1.0"?>
<!DOCTYPE catalog SYSTEM "catalog.dtd" [
<!ELEMENT book (title,price)>
]>
<catalog>
<book>
<title> Good Book</title>
<price> 100.00 </price>
</book>
</catalog>
Error (for the declaration in the DTD)
The element 'book' is already declared.
<!ELEMENT book (title,isbn,price)>
----------^
Is this the normal behavior that an element
declaration cannot be overridden
Thanks
Milo Tan
Greenhorn

Joined: Feb 08, 2002
Posts: 3
Hi,
Yes, that is the normal behavior. If your DTD declaration also use an external DTD declaration, only ENTITY and ATTLIST declaration may be overridden.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: internal DTD override
 
Similar Threads
DTD questions
question on mock exam
Castor Problem Using DTD
Internal DTD & External DTD
question on mock exam