Hi,
I've been using .NET for ages now but recently have started using it in conjunction with XML.
I have a v.simple XML document with DOCTYPE reference to my DTD at the top which I wish to validate the XML against, however when I load the XML into a XMLDocument object I get the following error:
System.Xml.XmlException: The expected DTD markup was not found. Line 1, position 3.
My XML file is:
<!DOCTYPE note SYSTEM "<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
My DTD is:
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
I'm guessing it's some sort of path issue, I've also tried the absolute C:\ path ref for the dtd file without luck.
If anyone can point me in the right direction it will be much appreciated!
Thanks in advance,
I've been using .NET for ages now but recently have started using it in conjunction with XML.
I have a v.simple XML document with DOCTYPE reference to my DTD at the top which I wish to validate the XML against, however when I load the XML into a XMLDocument object I get the following error:
System.Xml.XmlException: The expected DTD markup was not found. Line 1, position 3.
My XML file is:
<!DOCTYPE note SYSTEM "<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
My DTD is:
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
I'm guessing it's some sort of path issue, I've also tried the absolute C:\ path ref for the dtd file without luck.
If anyone can point me in the right direction it will be much appreciated!
Thanks in advance,