I would use the function Document::write_to_file_formatted to write an XML file.
The problem is that i was not able to have the output formatted in a right way, it is like it's not formatted.
I try then to compile an xml2 example to see if it produces an output well formatted and it's ok.
[http://xmlsoft.org/examples/tree2.c].My analysis is (but maybe i am wrong) that function write_to_file_formatted is a wrapper for do_write_to_file.
(obviously)
In do_write_to_file, the first line is KeepBlanks k(KeepBlanks::Default).
It seems to me that it sets libxml2's keepsblanks (or something like that) to the value true using a const value (KeepBlanks::Default, which i can't modify).
It seems
to me that to produce a formatted output the following conditions must be satisfied:
1) keepsblanks = false
2) xmlIndentTreeOutput = 1
Can you explain me how to achieve the desired formatted output, please?
Thank you in advance,
Andrea
ps: apologize for my english.