I have been trying to work with Delphi 2010 and MSXML for the past few days, I am an extreme novice 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 am able to load the data into an XML file on harddisk, I then load that file into a DomDocument. I'm stuck from this point on...I want to use this data as I would a recordset in ADO (ex. SomeVariable := rs.Fields.Item('DesiredData').Value). I have done some research and read several methods. However I am unable to figure this one out. I know its got to be something trivial, I'm just not far enough along yet to understand it.
There seem to be plenty of good examples on how to write to an XML file but none on howto use the data.