rajivjoshi Posted February 4, 2012 Share Posted February 4, 2012 Hi I'm new to XML..I need some clarification. i just took a small part of code from W3.. <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE note SYSTEM "c:/Rajiv/Note.dtd"><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note> And saved in C:/rajiv/note1.xml <!DOCTYPE note[<!ELEMENT note (to,from,heading,body)><!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT heading (#PCDATA)><!ELEMENT body (#PCDATA)>]>and even saved the DTD file as Note.dtd in same folder C:/rajiv/note.dtd when i open the xml file it is showing as error as below.. The XML page cannot be displayedCannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.Cannot have multiple DOCTYPE declarations. Error processing resource 'file:///c:/Rajiv/note.dtd'. Line 1, Position 11<!DOCTYPE note----------^ Can and one help me.. Link to comment Share on other sites More sharing options...
sgbarrage Posted February 17, 2012 Share Posted February 17, 2012 Change your dtd file content to like this <!ELEMENT note (to,from,heading,body)><!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT heading (#PCDATA)><!ELEMENT body (#PCDATA)> that means no <!DOCTYPE> inside the dtd file. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.