unit Unit1;
interface
uses
System.SysUtils, System.Variants, System.Classes,
Vcl.Controls,
Vcl.Forms,
Vcl.StdCtrls,
Xml.XMLDoc,
Xml.XMLIntf;
type
TForm1 =
class(TForm)
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
XMLDoc: IXMLDocument;
RootNode, StuffNode, MessageNode: IXMLNode;
begin
Memo1.Clear;
XMLDoc := NewXMLDocument('
');
RootNode := XMLDoc.AddChild('
xml-model');
RootNode.SetAttributeNS('
href', '
', '
myFile.xsd');
StuffNode := RootNode.AddChild('
stuff');
MessageNode := StuffNode.AddChild('
message');
MessageNode.NodeValue := '
Hello World';
// Memo1.Lines.Assign(XmlDoc.Xml);
// oder:
Memo1.Lines.Add(FormatXMLData(XMLDoc.Node.Xml));
end;
end.