[xml] [Repost] Backwards compatibility and memory management...



Sorry for the repost that may one day pass moderator approval ;-)
(as I was not subscribed...)

Here is my original post:

=====================================
Hello all ;-)

   I'm completely new to using the libxml2 api's and have
a couple questions...

First question:
===============
    I am currently overseeing an upgrade of an embedded system
from glib/gtk+ libraries from 1.2 --> 2.2, and we are useing
the old libglade which holds a dependancy on libxml (libxml2 ?)

The libxml2 that we currently ship with is 2.2.12  (which doesn't
seem to even be present anymore at ftp://xmlsoft.org)

Is it sane to upgrade to a recent version of libxml2 ?
will it break the old glade ?
(a glade which was linking against libxml-2.0)


Second question:
===============
    In the version of libxml I am currently using, the only trace
I can find to free resources allocated by libxml was "xmlCleanupParser();"

So, I would want to know if xmlCleanupParser() is really going to free all
the xmlDoc's allocated etc etc..

Plus, the example code that comes with the package allocates a structure
and fills its string paramaters with "xmlNodeListGetString" directly,
but I cant find any trace of where this memory is comming from (ok, so it
shows that I haven't read the source yet ;-P )

Sooooo, I would also like to know it xmlNodeListGetString() always allocates
a duplicate string ? and can that string be safely freed with traditional
"free()" from stdlib.h ?


I think that's all for now, If I can get libxml2 old an new versions to
parallel install and use the new-and-improved api for any new work, that
will be good enough ;-)

Cheers,
                                   -Tristan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]