There is an error in XML document --> System.Xml.XmlException: '', hexadecimal value 0x02, is an


  Product(s): APM Implementation and Performance Management  
  Version(s): 7.18.32.18  
  Environment: N/A  
  Area: N/A  
  Subarea: N/A  

Problem Description

Application throwing below error while Exporting and Searching inspection reports.

Error   Ivara.PL.Client.ServerCallRequest [18] System.InvalidOperationException: There is an error in XML document (3, 103). ---> System.Xml.XmlException: '', hexadecimal value 0x02, is an invalid character. Line 3, position 103.

 

Solution

There is an invalid Unicode character "&#x2" in reports. Issue likely originates from Copy/cut and paste from Word or other rich text format which utilizes and supports such invisible characters, mostly older, low number hexadecimal values. To solve issue, Open Thick Client without admin role, Edit/redraft reports and remove hexadecimal value from reports and save.

Steps to find invalid character:

1. Copy error log from log file and paste it in Notepad++ OR Export report to Excel in thick client, copy HTML Text column (LingString Datatype) like Inspection Analysis, Inspection Summary, Recommendations in Notepad++ (Make Sure Hex-Editor Plugin in installed for Notepad++)
2. In Notepad++, go to View > Show Symbol > Show All Characters. This can reveal hidden or control characters that may not be visible 
3. Check for highlighted ISO name or Unicode character. in this case, see below screenshot - STX is an ISO name.

4. Find location of invalid character in data and remove it from thick client. it may not be visible in thick client.

You can avoid these types of error by removing invalid character before adding data in application.

1. You can manually enter data (Without Copy, Paste) in HTML Text column (LongString Datatype) like Inspection Analysis, Inspection Summary, Recommendations
2. If you want to copy data from Word or other rich text format which utilizes and supports such invisible characters, then first paste that data in Notepad, check any invalid character and remove it. now copy data from Notepad and paste it in application.

Should this not resolve the issue please report the issue as a case to APM Technical Support.

See also

Link to check unicode character - https://unicodeplus.com/U+0002