• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DTD

 
Luciano Queiroz
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a doubt.
How many DTDs can be associated with a given XML document?
The book Professional XML 2nd Edition says that only one DTD may be associated. Then it says: one or more DTD declarations may be included in the internal subset, which is contained within the DOCTYPE declaration.
Is it correct? Please explain me.
Thanks in advance!
 
Luciano Queiroz
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't understand what the book means to say.
At a moment it says: The DOCTYPE declaration may appear only once in a XML document. It must follow the document's XML declaration, if any, and precede any elements or characters data content.
Latter it says: One or more DTD declarations may be included in the internal subset, which is contained whithin the DOCTYPE declaration. These declarations are limited by square brackets [...], and must appear after all the other parameters of the DOCTYPE declaration.

Can anyone explain me this?
 
Vibha Verma
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book means to say that the DOCTYPE declaration can only occur once, i.e. the DOCTYPE statement cannot be more than one in an XML document. The syntax of this statement can take any of these two forms:
<!DOCTYPE doc_Name SYSYTEM location [internal_subset]>
<!DOCTYPE doc_Name PUBLIC identifier location [internal_subset]>
The [internal_subset] part of this DOCTYOE statement can contain a number of declarations for elements, attributes, entities etc.
So there can be only one DOCTYPE statement but the internal_subset part of the DOCTYPE statement can contain a number of declarations.
I hope this explanation helps.
Vibha.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic