 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Serge Guest
|
Posted: Wed Aug 20, 2003 6:24 am Post subject: XML access violation |
|
|
I'm trying to make use of xml documents in a console application an get an
access violation :(
Someone a clue ?
function WriteModifierLog(_xmlfile, projectcode, _dataline : string) :
boolean;
var
mydoc : TXMLDocument;
_xmlNode, configNode : IXMLNode;
begin
try
mydoc := TXMLDocument.Create(nil);
mydoc.Active := true;
_xmlNode := mydoc.DocumentElement.AddChild('FBVL'); --> I get an
access violation here, does someone know why ?
ConfigNode := _xmlNode.AddChild('ProjectCode');
ConfigNode.Text := projectcode;
ConfigNode := _xmlNode.AddChild('DataBlob');
ConfigNode.Text := _dataline;
ConfigNode := _xmlNode.AddChild('DateTime');
ConfigNode.Text := DateTimeToStr(now);
mydoc.SaveToFile('c:text0.xml');
except
on e: exception do showmessage(e.message);
end;
end;
|
|
| Back to top |
|
 |
Serge Guest
|
Posted: Wed Aug 20, 2003 8:21 am Post subject: Re: XML access violation |
|
|
I got it now :)
but, new question, how can do that the application is appending new
childnodes to the xml document.
as soon as I redo a create if flushes the existing document, but I need to
append data all the time to one existing document ?
thnx
"Serge" <serge (AT) telecontact (DOT) lu> wrote
| Quote: | I'm trying to make use of xml documents in a console application an get an
access violation :(
Someone a clue ?
function WriteModifierLog(_xmlfile, projectcode, _dataline : string) :
boolean;
var
mydoc : TXMLDocument;
_xmlNode, configNode : IXMLNode;
begin
try
mydoc := TXMLDocument.Create(nil);
mydoc.Active := true;
_xmlNode := mydoc.DocumentElement.AddChild('FBVL'); --> I get an
access violation here, does someone know why ?
ConfigNode := _xmlNode.AddChild('ProjectCode');
ConfigNode.Text := projectcode;
ConfigNode := _xmlNode.AddChild('DataBlob');
ConfigNode.Text := _dataline;
ConfigNode := _xmlNode.AddChild('DateTime');
ConfigNode.Text := DateTimeToStr(now);
mydoc.SaveToFile('c:text0.xml');
except
on e: exception do showmessage(e.message);
end;
end;
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|