I have an XML file that is initially formatted using space indentation (2 spaces for each nested element).
When I load and save this file using IXMLDocument, the space indents change to tabs (code # 9).
Here is the code:
var FileName: String; Document: IXMLDocument; ... Document := XMLDoc.LoadXMLDocument(FileName); Document.SaveToFile(FileName);
I tried using the NodeIndentStr property - there is no result:
Document := XMLDoc.LoadXMLDocument(FileName); Document.NodeIndentStr := ' '; Document.SaveToFile(FileName);
Used FormatXMLData too - no result:
Document := XMLDoc.LoadXMLDocument(FileName); Document.XML.Text := XMLDoc.FormatXMLData(Document.XML.Text); Document.Active := True; Document.SaveToFile(FileName);
How to save space values ββinstead of tabs?
Andrew
source share