Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
cara_ay
Contributor II
Contributor II

[RESOLVED] Is it possible to reference a column in TalendString.replaceSpecialCharForXML("") in the tMap?

Hi, I'm wanting to use the the TalendString.replaceSpecialCharForXML("") function to replace special characters that appears in a column in tMap. Is it possible to reference a column in the function rather than a string?

tDBinput -> tMap -> tWriteJSONfield -> tOutputDelimited

Job fails when using the below configuration and mapping formula in the tMap.

0695b00000JNMXiAAP.png

Thanks!

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

No, you need to extract the attribute before converting it.

View solution in original post

4 Replies
Anonymous
Not applicable

No, you need to extract the attribute before converting it.

aminegac
Creator
Creator

also check tXMLMap in case it may help you

Talend OS 4 yrs / Java 17 Web Dev
cara_ay
Contributor II
Contributor II
Author

Thanks @Jan Lolling​  I guess this function wouldn't help with what I'm trying to achieve then since the values in the attribute changes depending on the row queried from the database. I shall keep looking.

cara_ay
Contributor II
Contributor II
Author

Hi @amine kacem​ Thanks for the suggestion! I've tried this but it didn't make any difference. The main issue I'm having is that I'm getting the below error. I've checked all my columns in the database and there are no & (ampersand) and # (hash) characters found in my dataset.

 

So I'm just wanting to include a function in the mapping to ensure that they get replaced (or escaped) - seeing as Talend is somehow detecting these, even though I've checked and there isn't any showing in my data.

 

net.sf.json.JSONException: nu.xom.ParsingException: Character reference "&#

 

If you've come across this error before and know what may resolve this, it would be great to know.