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



xmlFree(doc) <- Doc is a doc pointer..  xmlFree clears your xml pointers,
structures, etc.


I will say it before Daniel (:-)), xmlCleanupParser is *NOT* called except
when you are completely done with LibXML.  It is really designed to cleanup
the library (Semantics, since the library *IS* the parser), not to clean up
after a parse.

As to your first question, I suggest upgrading on a test system and seeing
if it breaks..

Nothing like testing!


-----Original Message-----
From: xml-admin gnome org [mailto:xml-admin gnome org] On Behalf Of Tristan
Van Berkom
Sent: Tuesday, March 16, 2004 10:17 AM
To: xml gnome org
Subject: [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

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml




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