Re: [xml] Setting a new DTD



_impl->intSubset=NULL;
xmlUnlinkNode((xmlNode*)dtd);
xmlFreeDtd(dtd);

This code works for me. But since this is the first time I hack on raw
libxml (I've been using libxml++ for some time) I wanted to know if its
correct. I'm not sure if it works in all cases, if I've got all the node
linking right and that there are no memory leaks.

I would highly appreciate it if a libxml guru could take a look at it
as I intend to commit this to libxml++.

  All the refernces to the items defined in the DTD like entities
will become dandling pointers to freed areas. Might work for a
given application, but a very bad interface to expose in a library API.
Changing the strings in the DTD sounds safer, but probably don't
match what you expect. I would only allow this transformation as part
of a saving mechanism to avoid the broken references problem

Thanks for you reply, dandling pointers just smell like segfaults...
I'll go on and search for a different/better solution.

Thanks again,
Thomas




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