Here is the code example (insert it in UserMain):
uses Classes; // Add this to the top of the script function ReadXMLFile(Filename: String): String; var T: TStringList; S: String; begin T := TStringList.Create; try // Loads the XML file in the same path as the ebook EXE file. EbookPath := GetGlobalVar("HEPublicationPath", ""); S := EbookPath + Filename; T.LoadFromFile(S); // Gets the contents. Result := T.Text; finally T.Free; end; end;
var s = window.external.GetHEScriptCom('usermain.ReadXMLFile|mydata.xml', 'none'); alert(s);
Then your s variable contains the contents of the XML file.