[SOLVED]Compile Error: WriteXMLFile(xml_doc, file_name) lazarus / 64-FPC development ---------------------------------------------------------------------- kinlion · 2019-05-25 04:52 Lazarsu2.0.2 + FPC3.0.4 On Win10x64 I met with a weird problem: The compiler compains: Incompatible type for the arg no.2: Got "AnsiString", Expected "TStream" at this code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i WriteXMLFile(xml_doc, file_name); However, if I use WriteXML instead, it has no problem. I'm sure it's also no problem in Lazarsu1.8.4 + FPC3.0.4 On Win10x64 even using WriteXMLFile. Is it a bug? ---------------------------------------------------------------------- kinlion · 2019-05-25 05:33 ReadXMLFile is similar ---------------------------------------------------------------------- kinlion · 2019-05-25 05:41 Sorry. I made a mistake. The type of xml_doc should be TXMLDocument, but I defined it as a TDomDocument. ---------------------------------------------------------------------- ASerge · 2019-05-25 05:45 This one compiles without a problem: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses DOM, XMLWrite, XMLRead; var  S: string = '';  Doc: TXMLDocument = nil;begin  WriteXMLFile(Doc, S);  ReadXMLFile(Doc, S);end.Make a minimal project where the problem is reproduced.