且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何处理libxml2解析器错误

更新时间:2023-11-07 11:23:46

您可以使用 xmlSetStructuredErrorFunc xmlSetGenericErrorFunc .这些设置了全局的错误回调,因为您已经注意到,此时将没有任何xmlDocPtr上下文.

You can use xmlSetStructuredErrorFunc and xmlSetGenericErrorFunc. These set error callbacks globally, because as you've noted, there won't be any xmlDocPtr context at this point.

http://www.xmlsoft.org/html/libxml-xmlerror.html