RE: [xml] Bug or User Error

Well as I stated below, the rant Daniel went on below was not helpful, and off target..

I changed the way the code works, so that doc=xmlParseFile is only called once.
Now it seems to function.  This still is either and error in the documentation (Unlikely) or the xmlParseFile is not properly functioning.  Each time I called xmlParseFile, I also called xmlFreeDoc, therefore there should be no problem calling it 3000 times, let alone 6.
And on the "Why bother building docs" tirade.  The documentation website is rather hard to navigate.  It takes some time to find what one is looking for.  I am not really sure how you got to the doc below that you are mentioning.  I added the xmlCleanupParser based upon an example that I saw while I was waiting for an answer from the mailing list.

From: Daniel Veillard
Sent: Thu 1/29/2004 14:10
To: Ron Ohmer
Cc: xml gnome org
Subject: Re: [xml] Bug or User Error

On Thu, Jan 29, 2004 at 12:58:36PM -0500, Ron Ohmer wrote:
> Does anyone have a suggestion as to why I am getting an unhandled exception on a doc=xmlParseFile(filename).
> It is around the 6th time it runs in a program (Same every time), so I suspect it is running out of stack space..  After every run thru the parser I am sure to run:
> xmlFreeDoc(doc); 
> xmlCleanupParser();
> So, I am confused as to how I am leaving open memory out there.  My stack is:

  Do NOT , I repeat and repeat again and again and again
    DO NOT CALL xmlCleanupParser ON ALL PARSE !!!
DO CALL xmlCleanupParser when your are done with the LIBRARY !!!
 "Cleanup function for the XML library. It tries to reclaim all parsing
  related global memory allocated for the library processing. It doesn't
  deallocate any document related memory. Calling this function should
  not prevent reusing the library but one should call xmlCleanupParser()
  only when the process has finished using the library or XML document
  built with it."

  You're using 4 function. Tell me WHY reading the doc for the 4 function
is asking too much of your time and asking on the list is a better option ????

  Why bother building docs ? People simply don't bother to read them :-(
it is *extremely* frustrating :-(
  Why did you call xmlCleanupParser() for each document ????


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]