Expand my Community achievements bar.

SOLVED

ImportData Error Trapping

Avatar

Level 2

I have designed a form where an externally created XML file is imported into the form via xfa.host.importData(); This typically works great except when there are certain special characters in the XML fields (&, accent symbols, etc.). In this case, the form just goes blank. I've been able to replace most of the special characters in the XML files, but there are still some that I haven't been able to chase down. Is there a way to do error trapping on this to be able to know where the problem is in the XML file?

1 Accepted Solution

Avatar

Correct answer by
Level 2

Thank you for the reply. The issue isn't the syntax of the xml file. That is fine. What was happening is that characters such as accent symbols (grave and acute instead of single quote) were in the source text for the field itself. I was able to resolve this by replacing many of the characters before they were added to the XML file and using a different type of encoding - ISO-8859-1, instead of UTF-8.

View solution in original post

2 Replies

Avatar

Level 10

You can use an XML validator to check your XML file. XML Validator

Avatar

Correct answer by
Level 2

Thank you for the reply. The issue isn't the syntax of the xml file. That is fine. What was happening is that characters such as accent symbols (grave and acute instead of single quote) were in the source text for the field itself. I was able to resolve this by replacing many of the characters before they were added to the XML file and using a different type of encoding - ISO-8859-1, instead of UTF-8.