Re: [xml] how to catch error messages in xmlParseDoc

On Tue, Feb 04, 2003 at 06:28:26PM +0100, Dejean Mansuy wrote:
Hello again ;)

When you use the function xmlParseDoc, if the document is not valid it
messages to stderr like:
"Entity line 3: error: Opening and ending tag mismatch: applicaton and

I'd like to catch that kind of messages and put them into a char*

I tried in adding in my function:

xmlValidCtxt  cvp;
char          *validError;

cvp.userData = validError;
cvp.error    = (xmlValidityErrorFunc) sprintf;
cvp.warning  = (xmlValidityWarningFunc) sprintf;

but I dont know how to bind it with xmlParseDoc...
errors can also be associated directly to the parser context but
xmlParseDoc does not give access to that level.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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