Re: [xml] Bug or User Error



With all due respect, Daniel, I kind of agree with some of this.  I've
been using libxml2 for quite a while, and I've done my best to study
the documentation, the tutorials, the mailing list archive, and I've
pored over the source code myself, walked through it with the debugger
step by step, et cetera, and I *still* get snagged by features or
"features" which, no doubt, are clear to you when you built them,
but which catch me by surprise.  

I'm not a fool, either.  I've been writing large production scientific
code for 18 years, all on Multics/Unix/Linux systems and generally with
open software and GNU tools.  

Unfortunately, the documentation for libxml2 is just not especially
well-organized and decidedly incomplete.  I'm not complaining about
that -- you've done great work on the library itself, it *is* an
open-source project, and anyone who doesn't like it is free to do a
better job.

But -- it's a little often the case that you yell at people for being
dumbheads and not reading the docs, etc. -- a little too often, IMHO.
You don't have to be an especial dumbhead to be puzzled or surprised
by libxml2, for reasons above.  It may be that the people who are writing
to the list are not quite as dumb or lazy as you may be assuming.  And 
in any event, we all ask dumbass newbie questions from time to time.  It's
not unreasonable to hope that, therefore, when it's our turn to be the
expert, we're a little patient with those just get starting.

I'm not trying to be a jerk or unappreciative of all you've done, and
I know very well what it's like to be frustrated in the way you are.
Just some feedback, is all, perhaps food for thought.

CJG

On Thu, Jan 29, 2004 at 10:37:42PM -0500, Ron Ohmer wrote:
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.

Ron



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 !!!

http://xmlsoft.org/html/libxml-parser.html#xmlCleanupParser
 "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

-- 
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]