GuruPrasad Das
GuruPrasad Das

Reputation: 19

XML Parsing Error: The markup declarations contained or pointed to by the document type declaration must be well-formed

I have an XML document as shown below:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE IMPORTANT_DAYS PUBLIC "-//XYZ//DTD Declarations(ImportantDays)//EN" "dtds/important_days.dtd">
<IMPORTANT_DAYS>
    <MONTH name="January">
        <DAY    date="9"    occassion="NRI Day"/>
        <DAY    date="10"   occassion="World Laughter Day"/>
        <DAY    date="12"   occassion="National Youth Day"/>
        <DAY    date="15"   occassion="Army Day"/>
        <DAY    date="25"   occassion="National Tourism Day"/>
        <DAY    date="26"   occassion="Republic Day Of India;International Customs Day"/>
        <DAY    date="30"   occassion="Martyr's Day;World Leprosy Day"/>
    </MONTH>
</IMPORTANT_DAYS>

And the following DTD file named- important_days.dtd:

<!ELEMENT IMPORTANT_DAYS (MONTH+)>
<!ELEMENT MONTH (DAY+)>
<!ELEMENT DAY EMPTY>
<!ATTLIST MONTH name NMTOKEN #REQUIRED>
<!ATTLIST DAY date NMTOKEN #IMPLIED>
<!ATTlIST DAY count NMTOKEN #IMPLIED>
<!ATTlIST DAY day NMTOKEN #IMPLIED>
<!ATTLIST DAY occassion CDATA #REQUIRED>

When I am trying to parse the XML file I am getting the following error at line 6 in "important_days.dtd":

6:The markup declarations contained or pointed to by the document type declaration must be well-formed.

Can anyone point out what is the problem ?

Upvotes: 0

Views: 4687

Answers (1)

Jim Garrison
Jim Garrison

Reputation: 86774

XML is case-sensitive. Notice the lowercase L characters, which should be uppercase:

Line 6: <!ATTlIST DAY count NMTOKEN #IMPLIED>
             ^

Line 7: <!ATTlIST DAY day NMTOKEN #IMPLIED>
             ^

Upvotes: 2

Related Questions