|
NativeXml Help
|
Drop a TEdit (Edit1), TButton (Button1) and a TMemo on your form, then connect the code below to the OnClick event of the button. Fill in the filename in Edit1, then click the button and you will see the contents of the XML file listed in the memo control.
procedure TForm1.Button1Click(Sender: TObject); var ADoc: TNativeXml; begin Memo1.Lines.Clear; ADoc := TNativeXml.Create; try ADoc.LoadFromFile(Edit1.Text); ADoc.XmlFormat := xfReadable; Memo1.Lines.Text := ADoc.WriteToString; finally ADoc.Free; end; end;