So, I've been searching but couldn't find an answer.
There's a question on SOF about creating large XML's causing this Out of Memory exception, but that's not my case.
I'm creating a XML using IXMLDocument via XML Data Binding, and it's created just fine.
But when saving it to file, it's all in one single line of text. The way to go was to passing the XML through FormatXMLData just before saving it to file.
This works great on small files, but crashes with an EOutOfMemory if the XML is large enough.
So I tried adding the option [doNodeAutoIndent], but didn't work either.
Next move, I created a TStringList to receive the XML, so I could deactivate the IXMLDocument, and then try the FormatXMLData on the TSringList. I wasn't expecting much of this, but I figure maybe these two components use different memory manager (am I wrong believing the IXMLDocument uses COM memory manager instead of Delphi's?), and reality came that much close to expectations, as the same exception was raised.
Anyone has an idea of how to have my xml saved correctly indented and formated when using XML Data Binding, either with FormatXMLData or any other option?
Reading similar questions here on StackOverFlow, I saw some alternatives, including a SAX parser to replace DOM based IXMLDocument, but I believe that would disable the advantage of XML Data Binding, isn't it so?
Thank you, Nuno