I have been trying to work with Delphi 2010 and MSXML for the past few days, I am an extreme beginner and need a little direction.
var
MemoryStream: TMemoryStream;
XMLPath: String;
sName: String;
XMLDoc: variant;
doc: TStringList;
begin
//unrelated code
// Create XML File to hard disk
begin
MemoryStream := TMemoryStream.Create;
IdHTTP1.get('http://somewebsite' + , MemoryStream);
MemoryStream.Position := 0;
MemoryStream.SaveToFile('data.xml');
MemoryStream.Free;
end;
// Load XML file for data display
doc:=TStringList.Create;
doc.LoadFromFile('data.xml');
XMLDoc := CreateOleObject('Msxml2.DOMDocument.6.0');
XMLDoc.async := false;
XMLDoc.LoadXML(doc.Text);
As you can see, I can load the data into an XML file on the hard drive, then load this file into DomDocument. I am stuck from now ... I want to use this data as I would make a set of records in ADO (e.g. SomeVariable: = rs.Fields.Item ('DesiredData'). Value). I did some research and read some methods. However, I cannot understand this. I know that this has become something trivial, I am not far enough to understand this.
There seem to be many good examples of how to write to an XML file, but none of them use data.