IBM Support

ICM: Troubleshooting parsing errors when using XML import APIs on machines with a non-Unicode default encoding

Question & Answer


Question

DB2® Information Integrator for Content Version 8.2 fix pack 1 corrects a problem where the XML export API encodes files in the machine's default language while declaring the files as UTF-8. As a workaround, you can manually correct each file's encoding declaration.

Answer

Problem: In the DB2 Content Manager Version 8.2 connector, the XML export API encodes text in the machine's default language instead of UTF-8. For example, when a user exports an item with Japanese characters to an XML file onto a machine defaulted at Japanese (Shift_JIS), the API encodes the file in Shift_JIS--however, the exported file incorrectly declares UTF-8 as the XML file's encoding.

Example from XML file:

Before


<?xml version="1.0" encoding="UTF-8"?>

After
<?xml version="1.0" encoding="Shift_JIS"?>

Solution: Version 8.2 Fix Pack 1 resolves this problem. As a workaround, you can manually edit the XML file to the correct encoding (in the above example, to Shift_JIS). This ensures successful parsing of the XML file. Otherwise, users might receive the following type of exception when they attempt to import the file:



com.ibm.mm.sdk.common.DKUsageError: DGL0551A: XML ??????????????? :The element type "dataValue" must be terminated by the matching end-tag "</dataValue>". (ExportFile1.xml:27:13)
at com.ibm.mm.sdk.common.DKXMLUtil.xmlImport(DKXMLUtil.java:239)
at com.ibm.mm.sdk.common.DKDDO.fromXML(DKDDO.java:285)

[{"Product":{"code":"SSRS7Z","label":"IBM Content Manager Enterprise Edition"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"DB2 Information Integrator for Content","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.1;8.2","Edition":"Edition Independent","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSRS7Z","label":"IBM Content Manager Enterprise Edition"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Usage","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF027","label":"Solaris"},{"code":"","label":"UNIX"},{"code":"","label":"Windows 2000"},{"code":"","label":"Windows NT"},{"code":"","label":"Windows XP"}],"Version":"8.1;8.2","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
06 July 2019

UID

swg21115344