Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Internal and external subsets

 
Deepti Chalichama
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I read that a document type declaration can point to an external subset containing markup declarations, or can contain the markup declarations directly in an internal subset, or can do both.
Why would you need both an internal subset and external subset..is it not equivalent to declaring the markup elements twice?
Thanks,
Deepti.
 
Shashank Tanksali
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any declarations in the internal DTD take precedence over similar declarations in the external DTD.
For example, you might have a standard DTD which is publicly available and used by all organizations belonging to a particular business domain. It makes sense to use any standard DTD, which is in use for a particular kind of a business rather than invent your own. In such a situation you would want to use an external DTD. However not everything in the external DTD might suit your requirements, in which case, you can override any declarations selectively in the internal DTD.
Also another situation, where you might want to use both an internal and external DTD is if you have two (or more) XML documents, which share a set of declarations, then it is better to put the common set of declarations in an external DTD and put the specific declarations in the individual XML document. That way if the declaration needs to be modified, then it needs to be done in only one place.
Hope this helps . . .
Shashank
SCJP2,SCJD2
IBM Certified Developer - XML and Related Technologies
 
Deepti Chalichama
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Shashank!
So we are overriding declarations in the external DTD by declaring them again in the internal DTD.
Deepti
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic