
Anonymous
Not applicable
2012-08-21
08:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
replaceSpecialCharForXML Replacing & on escape characters
I have a job that takes in an MySQL input, performs a tmap then produces an xml output file via the advanced xml output plugin (I have selected UTF8 format). I use the replaceSpecialCharForXML function to replace any characters like apostrophe, ampersand, etc into the correct xml format.
My issue is that this replaceSpecialCharForXML function is replacing the apostrophe and then also replacing the ampersand with another xml escape character.
Eg,
Sample data: Mr Jone's
Expected xml output using replaceSpecialCharForXML: Mr Jone's
What is occuring: Mr Jone's
Surely this function is not supposed to replace the & that is the apostrophe escape character?
Any help or advice would be appreciated.
Thanks
Steph
My issue is that this replaceSpecialCharForXML function is replacing the apostrophe and then also replacing the ampersand with another xml escape character.
Eg,
Sample data: Mr Jone's
Expected xml output using replaceSpecialCharForXML: Mr Jone's
What is occuring: Mr Jone's
Surely this function is not supposed to replace the & that is the apostrophe escape character?
Any help or advice would be appreciated.
Thanks
Steph
239 Views
2 Replies

Anonymous
Not applicable
2012-08-22
03:40 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
This function works well,
tFileInputDeliimited--main--tMap--main--tLogRow
I can see the correct result on the console
Mr Jone's
the problem occurs on tAdvancedFileOutputXML component
tFileInputDeliimited--main--tMap--main--tLogRow--tAdvancedFileOutputXML
If I open the xml file in editor, it displays Mr Jone's, if I open the xml file directly in browser, it displays Mr Jone's.
This function works well,
tFileInputDeliimited--main--tMap--main--tLogRow
I can see the correct result on the console
Mr Jone's
the problem occurs on tAdvancedFileOutputXML component
tFileInputDeliimited--main--tMap--main--tLogRow--tAdvancedFileOutputXML
If I open the xml file in editor, it displays Mr Jone's, if I open the xml file directly in browser, it displays Mr Jone's.
239 Views

Anonymous
Not applicable
2012-08-22
12:34 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't understand why you escape these special characters, using a tFile(advanced or not)OutputXML should produce a valid XML file and escape them for you.
It seems to me you're doing twice the job and that's why it ends up like this. Furthermore you're using UTF-8 so you shouldn't have the problem I encountered here : https://community.talend.com/t5/Design-and-Development/Encoding-issue-with-tFileOutputXML/td-p/76368
It seems to me you're doing twice the job and that's why it ends up like this. Furthermore you're using UTF-8 so you shouldn't have the problem I encountered here : https://community.talend.com/t5/Design-and-Development/Encoding-issue-with-tFileOutputXML/td-p/76368
239 Views
