on 11-20-2013 8:42 AM
Hi Experts,
It's a file to proxy scenario. Sometimes the input file has some special characters, hence it's leading to the error 'An invalid XML character (Unicode: 0x13) was found in the element content of the document'. It occurs at the mapping runtime.
I've tried saving the input file encoding as ANSI/UNICODE/UTF-8. But in all cases i'm gettting the above error.
Any idea to overcome this issue? Thanks in advance!
Regards,
Senthil J
Hi All,
In the above sceanrio the sender is SFTP channel. I'm using messageTransfromBean for the content coversion. Now i want to avoid/skip that field(which is having the unicode character) in the adapter level. Is there any parameter in messageTransformBean will help for this?
Thanks in advance!
Regards,
Senthil J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Senthil
Also by writing the java code below you can ignore the unicode characters from file
public String stripNonValidXMLCharacters(String in) {
StringBuffer out = new StringBuffer();
char current;
if (in == null || ("".equals(in))) return "";
for (int i = 0; i < in.length(); i++) {
current = in.charAt(i);
if ((current == 0x9) || (current == 0xA) || (current == 0xD) ||((current >= 0x20) && (current <= 0xD7FF)) ||((current >= 0xE000) && (current <= 0xFFFD)) || ((current >= 0x10000) && (current <= 0x10FFFF)))
out.append(current);
}
return out.toString();
}
But the best solution will be correcting your sending system so that it will not send the unicode characters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Senthil
Try File Encoding with ISO-8859-1 or UTF-16 and see if it works or not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Senthil
In the sender file adapter you can find the file encoding field under Processing tab. Select File Type = Text and appears the option
Regards
Javi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.