简体   繁体   中英

EDOMParseError in Delphi XE4

I migrated my Delphi 7 code to Delphi XE4. I am getting error in the LoadFromStram method in Delphi XE4 but same is working fine for Delphi 7.

Error:

First chance exception at $7559C41F. Exception class EDOMParseError with message
'XML document must have a top level element.

Line: 0
'.
Process abc.exe (10516)


var
myStream : TStream;
....
....
LoadFromStream(myStream);

I am using XMLDoc, XMLIntf, XMLDOM in uses clause.

Your stream is either empty (like you loaded from an invalid file, or whatever, you don't give enough code to tell us how you populated the stream), or as TLama pointed out, you didn't reset to the beginning. ie seek(0);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM