Connecting Tech Pros Worldwide Forums | Help | Site Map

DTD is not working or validate the XML file Plz tell me what is the mistake?

Newbie
 
Join Date: Oct 2009
Posts: 9
#1: 4 Weeks Ago
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" ?> 
  2. <!DOCTYPE note [
  3.   <!ELEMENT note (to,from,heading,body)>
  4.   <!ELEMENT to      (#PCDATA)>
  5.   <!ELEMENT from    (#PCDATA)>
  6.   <!ELEMENT heading (#PCDATA)>
  7.   <!ELEMENT body    (#PCDATA)>
  8. ]>
  9. <note>
  10. <to>Tove</to> 
  11. <from>Jani</from> 
  12. <heading>Reminder</heading> 
  13. <message>Don't forget me this weekend!</message> 
  14. </note>

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,660
#2: 4 Weeks Ago

re: DTD is not working or validate the XML file Plz tell me what is the mistake?


what do you mean? is the DTD telling you the file is valid (which is wrong) or is it telling that the file is invalid (which is true)?
Reply