[xml] Custom Error Handling Dilemma



Title: Custom Error Handling Dilemma

Hi All,

        I'm new to libxml2 community so I'm not sure how relevant my problem is to others … I am using libxml2 (2.2.6) for validating XML docs against XML schemas and have implemented custom error handlers to catch the great parsing and validation warnings and errors. The current implementation of xmlReportError() invokes the error handlers multiple times for the same error, this makes it tricky to implement any kind of predictable error handling. i.e if you want to catch the error and log it or report it to another system. Why does xmlReportError() not buffer the entire error msg and report it to the generic or user defined handler in a single call ? That way people who implement their own error handlers could assume that they would only here about an error or warning once.

Is there another way to achieve this effect that I have overlooked?

Thanks in advance,

John



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