[resolved] java.lang.RuntimeException: An invalid XML character (Unicode: 0x1)

Highlighted
One Star

[resolved] java.lang.RuntimeException: An invalid XML character (Unicode: 0x1)

I need to store a unicode character in Talend that the target system uses as a separator value in its database.
It's 0x01/U+0001//start of header/^A.
I pasted the character directly into Talend and next time I ran it that job just came up blank (making me think I've lost all my progress!).
I checked the log and found this:
java.lang.RuntimeException: An invalid XML character (Unicode: 0x1) was found in the element content:"^A2^A"
Did some research and found that this character is supported in XML 1.1, but not 1.0 (http://en.wikipedia.org/wiki/Valid_characters_in_XML).
If I manually change the XML version of the item file to 1.1, Talend once again opens the job as blank.
Is there any way to fix this? Work around it?
I'm going to try loading the character from a file on the fly to avoid storing it in Talend's xml file. Even it works it would be ugly, so I'm looking for better solutions.
Thanks!

Accepted Solutions
One Star

Re: [resolved] java.lang.RuntimeException: An invalid XML character (Unicode: 0x1)

Have you tried mapping a string literal in a tMap to your output component? Something like
output_row.SEP_STRING="\u0001"
This should keep the Talend problems away. Are you passing this value along to a database query?

All Replies
One Star

Re: [resolved] java.lang.RuntimeException: An invalid XML character (Unicode: 0x1)

Have you tried mapping a string literal in a tMap to your output component? Something like
output_row.SEP_STRING="\u0001"
This should keep the Talend problems away. Are you passing this value along to a database query?
One Star

Re: [resolved] java.lang.RuntimeException: An invalid XML character (Unicode: 0x1)

Have you tried mapping a string literal in a tMap to your output component? Something like
output_row.SEP_STRING="\u0001"
This should keep the Talend problems away. Are you passing this value along to a database query?

That did it!
Thanks.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch