[xml] How to catch DTD validation error while using xmlParseFile()



I have an XML file which contains an internal DTD section, and I am using
xmlParseFile API. After setting xmlDoValidityCheckingDefaultValue to 1, when
there's a failure in DTD validatoin, libxml2 throws an error message to
stderr. However, it still returns a xmlDocPtr.  
My question is: How do I catch if there is any error in DTD so that I can
ignor the returned xmlDoc?

Thanks. 

Gang Wang  



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]