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

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?

View solution in original post


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?

View solution in original post

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 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog