Open GoogleCodeExporter opened 9 years ago
It looks like what was happening is that after parsing the first line of the
file (OmniXml.pas line 3411) the code tries to detect the encoding of the file,
and if found, rewinds the input stream reader so that it can read the contents
a second time.
I'm guessing that the output pointer isn't reset, and so on the second pass
(now with the correct encoding) it re-reads the first line into the output file
(or appends that same element to the XML structure).
I worked around this by using the following code to load my XML file:
Doc := CreateXMLDoc;
FS := TFileStream.Create('data.xml', fmOpenRead or fmShareDenyNone);
try
Doc.LoadFromStream(FS, CP_UTF8);
finally
FS.Free;
end;
Original comment by bduncanj@gmail.com
on 1 Oct 2013 at 10:59
Or there is XMLLoadFromFile helper function in OmniXMLUtils.pas
Original comment by Arioch...@gmail.com
on 9 Dec 2014 at 3:51
Original issue reported on code.google.com by
bduncanj@gmail.com
on 1 Oct 2013 at 10:08