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

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
> returns
> messages to stderr like:
> "Entity line 3: error: Opening and ending tag mismatch: applicaton and
> application"
> 
> 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...

  http://xmlsoft.org/html/libxml-xmlerror.html#XMLSETGENERICERRORFUNC
errors can also be associated directly to the parser context but
xmlParseDoc does not give access to that level.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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