Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

ImportData Error Trapping

grantefuller
Level 2
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
grantefuller
Correct answer by
Level 2
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
radzmar
Level 10
Level 10

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

grantefuller
Correct answer by
Level 2
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