Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DTD

 
lavanya Ananth
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new to XML.I have question on DTD's.

<! DOCTYPE myMessage SYSTEM �myDTD.dtd� [
<! ELEMENT myElement ( #PCDATA ) >

] >

The above DOCTYPE contains declarations from myDTD.dtd as well as internal declaration. How will a validating parser check for conformity if both of them(internal and external ) had conflicting declarations . Please clarify.

Thanks in Advance
Lavanya
 
Hari Vignesh Padmanaban
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by lavanya Ananth:
Hi,
I am new to XML.I have question on DTD's.

<! DOCTYPE myMessage SYSTEM �myDTD.dtd� [
<! ELEMENT myElement ( #PCDATA ) >

] >

The above DOCTYPE contains declarations from myDTD.dtd as well as internal declaration. How will a validating parser check for conformity if both of them(internal and external ) had conflicting declarations . Please clarify.

Thanks in Advance
Lavanya


The internal declarations will override the definition in the external DTD

So myElement declared internally will override any myELemnt declared in myDTD.Dtd and the parser should be able to support this. This is the standard way of resolving conflicting declarations

Hope this helps
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!