File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

internal DTD override

 
Gobiraj Vadivelrajan
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic