Re: [xml] stop saxparsing?

On Mon, Feb 09, 2004 at 06:14:09PM +0100, aliban gmx net wrote:
my parser reads a document and while it does this there might come 
some "tag" that should make the object doing the job to get deleted. 
whatever if i delete the memory that holds the document my 
application crashs (probably because the document was not finished...


static void x_endElement(void *ctx,const xmlChar *fullname)
      </some special element>
      // or maybe even
      delete (myclass*)ctx;

this crashs my app. how do i delete/free the memory of the parser if 
a special event (in the doc) appears?

  You can't do that ! Sax is callback based. You cannot break the flow of 
control from *within* a callback. Check xmlStopParser() but you simply
can't destroy the parser when you're called from within the parser !


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]