Jump to content

XML FF


adriantreanor
 Share

Recommended Posts

Im just learning XML. I typed the following into a xml file but when I go to test it in FF it gives me the followong error although there are no errors in the xml code. Can anyone help?. The XML file still wont open in FF.Im sorry the code I was going to display: <?xml version="1.0" encoding="utf-8"?><!DOCTYPE note [<!ELEMENT note (to,from,heading,body)><!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT heading (#PCDATA)><!ELEMENT body (#PCDATA)>]><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note> Error message:XML Parsing Error: XML or text declaration not at start of entityLocation: file:///C:/xml/TMP34fh9bl3c4.xmlLine Number 1, Column 9:<body ><?xml version="1.0" encoding="utf-8"?>--------^ Im sorry but there is no body tag even if the error message says there is. <?xml version="1.0" encoding="utf-8"?><!DOCTYPE note [ <!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> ]><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>

Edited by adriantreanor
  • Like 1
Link to comment
Share on other sites

You have an unneeded square bracket. at the end of that line.And before the error shows up, you need another ]> after that <!ELEMENT> entity to close the <!DOCTYPE> that's at the beginning of the document.

Link to comment
Share on other sites

The XML file still wont open in FF.Im sorry the code I was going to display: <?xml version="1.0" encoding="utf-8"?><!DOCTYPE note [ <!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)>]><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note> Error message:XML Parsing Error: XML or text declaration not at start of entityLocation: file:///C:/xml/TMP34fh9bl3c4.xmlLine Number 1, Column 9:<body ><?xml version="1.0" encoding="utf-8"?>--------^

Link to comment
Share on other sites

Im sorry but there is no body tag even if the error message says there is. < ?xml version="1.0" encoding="utf-8"?>< !DOCTYPE note [<!ELEMENT note (to,from,heading,body)><!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT heading (#PCDATA)><!ELEMENT body (#PCDATA)>]>< note>< to>Tove</to>< from>Jani</from>< heading>Reminder</heading>< body>Don't forget me this weekend!</body>< /note> XML Parsing Error: XML or text declaration not at start of entityLocation: file:///C:/xml/TMP4yhnhbl5pq.xmlLine Number 1, Column 9:<body ><?xml version="1.0" encoding="utf-8"?>--------^Can you help?.

Edited by adriantreanor
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...