Re: [xml] How Capture 'first' document parsing error



On Tue, Oct 05, 2004 at 08:31:16AM -0400, Knopp, Gary wrote:
Hello,
 
I'm a new user of  XML and XMLLIB and could use some help. How do you
capture the first document parsing error?
  
I found that if use the function xmlReadFile() I can prevent the errors
from going to the screen.  I see that I can get the last error through 
xmlLastError.  How do I capture the first error?  I figure that I
probaly need to create
my own error handler (xmlGenericErrorFunc???) after reading through the
archives.
However I haven't found any code snippets (at least working ones) that
can 
show me how to do this.

  There is no pre-cooked example but see the documentation this should be
simple:
    http://xmlsoft.org/html/libxml-xmlerror.html#xmlSetStructuredErrorFunc
    http://xmlsoft.org/html/libxml-xmlerror.html#xmlStructuredErrorFunc
  and
    http://xmlsoft.org/html/libxml-xmlerror.html#xmlError
 for the structure giving the details of the errors encountered.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://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]