Re: [xml] Proceed on error.

On Fri, Jan 14, 2005 at 11:19:50AM +0100, Morten W. J. wrote:
Hello all.

I use libxml (2.6.7) to check if a string of XML is well formed by running it 
through xmlParseMemory.

Sometimes, eg. when encountering "<nacho" or "<d></d><e>", libxml prints an 
error similar to 
"Entity: line 1: error: Couldn't find end of Start Tag nacho"
"Entity: line 1: error: Extra content at the end of the document" and halts 

I just want to catch if the returned doc is NULL or not, free it and return a 
proper value from my function. 

Any idea on how I get xmlParseMemory to proceed instead of halting or any 
alternative ideas?

  those are Well formedness errors. The processor will stop delivering data
from that point, it's mandatory behaviour.
  - so it can't "proceed", it has to "halt"
  - if you mean you don't want to see the errors,
    set up your own error handler.


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