[xml] Question: __xmlRaiseError internals



Hi!

I'm trying to obtain relaxng validation info in my program.
When I run the "testRelax"  application, if a required  element dows not
exists, I obtain the next info

"DTE_Agrosuper_reparo.xml:25: element Receptor: Relax-NG validity error :
Expecting an element , got nothing"

In my owen program, I register a error reporting callback, to store the
error message, and I only obtain
"Expecting an element , got nothing"

Browsing through libxml code, I find the next snippet of code

error.c, procesire __xmlRaiseError, line 566

if ((channel == xmlParserError) || (channel == xmlParserWarning) || (channel
== xmlParserValidityError) ||  (channel == xmlParserValidityWarning))
xmlReportError(to, ctxt, str, NULL, NULL);
else
if ((channel == (xmlGenericErrorFunc) fprintf) ||  (channel ==
xmlGenericErrorDefaultFunc))
    xmlReportError(to, ctxt, str, channel, data);
else
    channel(data, "%s", str);

"channel" is the error callback registered. In textRelax.c, channel is
"fprintf", therefore xmlReportError is called and the whole error message is
obtained
Since my own callback is not recognized by this code, the line
    channel(data, "%s", str);
is executed, and I obtain only the final setence of the error, loosign all
the relevant error context info.

Is there anyway to obtain the whole error info in my own callback?

Thanks
    Agustin




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