Sunday, September 6, 2009

Hello to solve the error -1072896636 when load xml file

I have a xml file which defines a internal DTD to validate its contend and make sure the format is valid.
 
But when I used xmlms 6.0 XML DOM object to load the xml file, the property parseError of the dom object says that there is a parse error. The error code is -1072896636  and its error message is DTD is prohibited.
 
The reason is that later than xmlms 6.0 one property named prohibitDTD's default value is changed to true by default while it was false in previous versions. So before load any xml file with internal DTD, you should remember to set the property to false before proceed to load the xml file.
 
Set xmlDoc = CreateObject("Msxml2.DOMDocument.6.0")
      xmlDoc.setProperty "ProhibitDTD",False
      xmlDoc.load xmltoload.xml
 
.......... 

No comments: