IBM Support

Error "org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1f) was found in the element content of the document" importing artifacts using the ETM Excel Import Utility

Troubleshooting


Problem

An error is thrown in IBM Engineering Test Management (ETM) Excel Import Utility log when you attempt to import test artifacts from a Microsoft Excel spreadsheet:

Example: 

org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1f) was found in the element content of the document

The importer tool generates XML from the spreadsheet's data to post the content to the ETM server. If the content contains invalid character, the server's XML parser cannot process that data. 

Symptom

A generic error in the ETMExcel Import Utility UI:

Error 400 Bad Request

A more detailed error in Mso2Rqm_Debug.log. Example:

org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1f) was found in the element content of the document

Cause

The spreadsheet contains characters that are invalid for the utility's XML parser. An example is the Unicode 0x1F, which is a Unit Separator (US) and used as a delimiter to separate items in text. It is not a valid XML character. 

Diagnosing The Problem

Review the ETM Excel Import Utility Mso2Rqm_Debug.log closely for the detailed error if a generic "bad request" thrown in the utility user interface. "org.xml.sax.SAXParseException: An invalid XML character " indicates that the parser encountered an invalid character. 

Resolving The Problem

One possible solution is to save the Excel file as a comma-separated text file (CSV) and use a text editor (such as Notepad ++) to find and replace the invalid Unicode control characters. Then, save the file again in Excel format and it should import if all invalid characters are replaced. 

The following is one possible solution by using Notepad ++.

Note: This process is not supported by IBM Technical Support.

  1. Save the Excel spreadsheet as .csv (comma-separated text file)
  2. Open the .csv file in an editor (such as Notepad++)
  3. Replace the invalid characters:
  4. Select Extended from Search Mode in Notepad ++.
  5. Search for: \x1f and replace with a single space
  6.  Save the .csv file in Notepad++
  7.  Open the .csv file in Microsoft Excel and save again in .xls format 
  8.  Attempt to import the spreadsheet again by using the ETM Excel Import Utility 

[{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSUVV6","label":"IBM Engineering Test Management"},"ARM Category":[{"code":"a8m0z0000001j1CAAQ","label":"Test Management->Utilities->ETMExcelWordImporter Utility"}],"ARM Case Number":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"All Versions"}]

Product Synonym

Rational Quality Manager

Document Information

Modified date:
24 August 2021

UID

ibm10719403