Converting 'JSON' to 'XML' data using 'Design By Example' in the REST data source adapter fails with an error

Converting 'JSON' to 'XML' data using 'Design By Example' in the REST data source adapter fails with an error

book

Article ID: KB0077089

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization All Supported Versions

Description

While clicking on the Design by Example button in the REST data source adapter when converting JSON to XML format, users may encounter the below error :

The value is not a legal XML value. An error occurred while parsing XML content: "Error reported by XML parser processing null: org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified. " 

Root cause:  
The error occurs when some fields in the JSON file contain special characters like '\', space, '_', '&', etc. These characters are valid for the JSON format. However, these characters are not compatible with XML. So when the JSON file gets introspected, TDV does not recognize these characters and throws the above error.  

Issue/Introduction

Converting 'JSON' to 'XML' data using 'Design By Example' in the REST data source adapter fails with an error "INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified".

Resolution

Follow the steps below to resolve this error:

1. Open the TDV Studio.

2. Navigate to "Administration" in the top tool bar top of the TDV Studio.

3. Browse to "Configuration-->Data Sources-->REST Sources-->Replace Invalid JSON Name for XML Conversion"
Change the above configuration value to TRUE, the default value is FALSE.

4. Browse to "Configuration-->Studio-->Data-->XML Text Size"
Increase the value for the above configuration value as per your requirement. The default value is 10000.

5. Apply the changes and click on OK.

NOTE: There is no need to restart the TDV services for these changes to take effect.