 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Marco Azevedo Guest
|
Posted: Thu Sep 01, 2005 12:50 pm Post subject: TClientDataSet Loading from a XML |
|
|
Hi,
The application wich I developed Save and Load xmls using ClientDataSet. Sometimes the xml files can be updated by third party applications. Often this third party application can make mistakes. Some mistakes the ClientDataSet raise an exception so there's ok, I get the exception and everybody is happy(smile). But some mistakes the ClientDataSet does not raise an exception and does not do nothing !!! It breaks my application. If you wanna cause this problem,
first of all save any ClientDataSet Data to a XML file
After that edit this XML file with notepad and exclude any </ROWDATA> tag
finally try do that ClientDataSet.LoadFromFile(MyFile.xml)
So the error occurs.
How can I solve that?
Thank you very much and sorry my english is begginer yet.
|
|
| Back to top |
|
 |
Douglas Wehmeyer Guest
|
Posted: Thu Sep 01, 2005 2:55 pm Post subject: Re: TClientDataSet Loading from a XML |
|
|
Marco,
You could try loading the doc into a TXMLDocument before loading the
Dataset. This should catch the error in the XML.
Example
procedure TForm1.Button2Click(Sender: TObject);
var
doc : TxmlDocument;
begin
try
doc := TxmlDocument.Create('C:MyXMLFile.xml');
ShowMessage(doc.XML.Text);
finally
doc.Free;
end;
cds.LoadFromFile('C:MyXMLFile.xml');
DataSource1.DataSet := cds;
end;
Sorry Marco I hit the wrong button to reply.
"Marco Azevedo" <azevedomt (AT) hotmail (DOT) com> wrote
| Quote: |
Hi,
The application wich I developed Save and Load xmls using
ClientDataSet. Sometimes the xml files can be updated by third party
applications. Often this third party application can make mistakes. Some
mistakes the ClientDataSet raise an exception so there's ok, I get the
exception and everybody is happy(smile). But some mistakes the
ClientDataSet does not raise an exception and does not do nothing !!! It
breaks my application. If you wanna cause this problem,
first of all save any ClientDataSet Data to a XML file
After that edit this XML file with notepad and exclude any </ROWDATA> tag
finally try do that ClientDataSet.LoadFromFile(MyFile.xml)
So the error occurs.
How can I solve that?
Thank you very much and sorry my english is begginer yet.
|
|
|
| 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
|
|