delphi‎ > ‎

TXMLDocumentの整形

2010/02/06 8:34 に いつかはちょうになる が投稿
OptionsにdoNodeAutoIndentを指定してから書き込み処理を行うと自動的に整形される。

var
  xml: TXMLDocument;
begin
  xml:=TXMLDocument.Create(Application);
  try
    xml.Active:=true;
    xml.Encoding:='UTF-8';
    xml.Version:='1.0';
    xml.Options:=[doNodeAutoIndent];
    (* 情報の書き込み処理 *)
  finally
    xml.Free;
  end;


Comments