Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QXmlDefaultHandler fatalError\error\warning are not triggered during invalid XML doc parsing



  • Hello!

    I've encountered the situation which is described in the topic theme above. I have: invalid XML document(incomplete tags, e.g <tag> without close </tag>), custom class which inherits QXmlDefaultHandler and overrides fatalError\error\warning virtual methods. I fed my invalid XML to the parser and it returned false but none of fatalError\error\warning methods were triggered.
    Does anybody know something about such behavior? Is it a bug or an undocumented feature? :)



  • Did you set

    @
    xmlReader.setErrorHandler(handler);
    @?

    See "QXmlDefaultHandler/Detail Descripton":http://doc.qt.nokia.com/4.7/qxmldefaulthandler.html#details for code snippets.



  • Doh! I've totally misinterpreted Qt docs. Volker, thank your for opening my eyes


Log in to reply