[xml] How to add a DTD to a document

2014-03-09 Thread Nick Wellnhofer
I can’t find out how to add a DTD (internal subset) to a document without poking into libxml2’s internal data structures. The obvious approach is to add a xmlDtdPtr using xmlAddPrevSibling on the document root. But this will cause a memory leak because xmlFreeDoc won’t free the DTD nodes. It on

Re: [xml] How to add a DTD to a document

2014-03-09 Thread Nikolay Sivov
On 3/9/2014 17:33, Nick Wellnhofer wrote: I can’t find out how to add a DTD (internal subset) to a document without poking into libxml2’s internal data structures. The obvious approach is to add a xmlDtdPtr using xmlAddPrevSibling on the document root. But this will cause a memory leak because

Re: [xml] How to add a DTD to a document

2014-03-09 Thread Nick Wellnhofer
> On 3/9/2014 17:33, Nick Wellnhofer wrote: >> I can’t find out how to add a DTD (internal subset) to a document without >> poking into libxml2’s internal data structures. The obvious approach is to >> add a xmlDtdPtr using >> xmlAddPrevSibling on the document root. But this will cause a memory l