libxml2 (for C) does not save empty elements in their original form when saved. It replaces <tag></tag>
with <tag/>
, which is technically correct, but causes problems for us.
xmlDocPtr doc = xmlParseFile("myfile.xml"); xmlNodePtr root = xmlSaveFile("mynewfile.xml", doc);
I tried playing with various options (using xlmReadFile
), but no one affects the output. One of the posts mentioned disabling tags, but the example was for PERL, and I did not find an analogue for C.
Is it possible to disable this behavior?
source share