GNOME Bugzilla – Bug 336765
Fix keep-entities (-k) XML merging
Last modified: 2019-03-25 23:13:34 UTC
This is listed in TODO, and the problematic part of xml2po.py is the following snippet in replaceNodeContentsWithText function: # Lets add document DTD so entities are resolved dtd = doc.intSubset() tmp = '' if expand_entities: # FIXME: we get a "Segmentation fault" in libxml2.parseMemory() when we include DTD otherwise tmp = dtd.serialize('utf-8') tmp = tmp + '<%s>%s</%s>' % (starttag, text, endtag) It seems now this was a problem with libxml2 (yet I suspected it was my code), since it now works for me without any problems on libxml2 2.6.21 (anyone knows when the change happened?). I am just adding it to Bugzilla since it's a common request, along with a very simple patch that should apply to many different xml2po versions (for those not wishing to recompile g-d-u from CVS).
Created attachment 62479 [details] [review] Re-enable keeping entities
Fixed in CVS, testcase added.
The bug was still in my own code, when doing in-place modifications of document tree in the same function. Improved fix in CVS.