I have a Button, a ListView and a XMLDocument-component on my form.
I have put the Button1Click procedure in the code-section. When I press
on the button it uses the XMLDocument-component to parse the xml-file
that is specified in the procedure. It searches for the nodes that begins with 'BG'
and displays from every node that begins with BG the values from Val, Dt and TM
into the Listview columns Value, Date and Time.
AND IT WORKS SUPER.
Now I want to add a fourt column called Day and every cell of the column Day
has to look in the cell Date and give the name of the day in the cell.
If you don't know what I mean. I have allready asked this question but then
I had a ClientDataset instead of a Listview.
Is that possible? I hope someone knows the answer and is willing to help me.
procedure TForm1.Button1Click(Sender: TObject);
LoopNodes : IDOMNodeList;
XMLDocument1.FileName := '.\MyDB.xml';
XMLDocument1.Active := True;
LoopNodes:= XMLDocument1.DOMDocument.getElementsByTagName( 'BG' );
for i:= 0 to LoopNodes.length -1 do
with ListView1.Items.add do begin
SubItems.Add( LoopNodes[i].attributes.getNamedItem('Tm').nodeValue );
SubItems.Add( LoopNodes[i].attributes.getNamedItem('Val').nodeValue );
XMLDocument1.Active := False;