BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

XML access violation

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet
View previous topic :: View next topic  
Author Message
Serge
Guest





PostPosted: Wed Aug 20, 2003 6:24 am    Post subject: XML access violation Reply with 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
Serge
Guest





PostPosted: Wed Aug 20, 2003 8:21 am    Post subject: Re: XML access violation Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.