Xml.LoadXml(File) Error and skips exception

MacOS Ventura 13.5.1
XOJO 2023.2

I have the following code

  If Xml <> Nil Then
    ' Get Patient Details 
    Var nodesPD As XmlNodeList
    nodesPD = xml.Xql("//patient")
    If nodesPD <> Nil Then
    End If
  End If
Catch e As XmlException
  System.DebugLog(CurrentMethodName + "Xml.LoadXML Error : " + e.Message)
  ... rest of the processing. 

It crashes on one corrupted file, i press on the XMLException in the debugger, it shows fast the error after which the app dies and debugger disappears like i hit stop.

I did a screen recording to see what is the error , i get as error

msg:XML parser error 4: not well-formatter (invalid token)

And the app stops

While i do have in the Catch the code that will inform that the file is corrupted and it moves the file to the corrupted folder, this one after the Xml.LoadXml(ProcFile) it throws the exception and stops not even reaching to the exception part in the code.

What is the issue here and what changed ? as in the past on the old versions of XOJO used to work well. i opened this project after 1 year from the last update.


Did you test Xojo2023r1.1?

Can you create an Issue and provide a sample project with sample corrupted file?

Is it possible that it’s not an XMLException that’s occurring?

1 Like