[xml] xmlSaveFormatFile not always formatting



My favourite way to format xml is to have indentations and newlines so I though xmlSaveFormatFile would be the best function for me to use. It outputs xml this way when the xml node it's saving is a newly created one with xmlNewDoc... however if I open an existing xml file with xmlParseFile and add anything to that node, calling xmlSaveFormat file will add the new stuff all on one line.

Here is a test case which demonstrates this behaviour: http://pastebin.com/m41938b74 Could someone explain to me why this is happening and if possible, suggest an alternative method (besides the obvious hacks of "remaking" a hierarchy in memory, node by node or manually inserting '\n' and '\t'). Thanks alot.



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