on 07-07-2011 2:19 PM
Hello,
in a file sender cc content conversion is used to transform a flat structure to XML. What we experiencecd is that the message mapping failed due to a character that was not allowed in XML:
I was assuming that the file content conversion just creates XML messages with allowed characters. Is there any way to configure content conversion to remove control characters which are not allowed in XML? Unfortunately the sender system cannot be modified.
Thank you.
Hi Florian,
Please use this UDF to remove special characters which prevent XML messages to form properly.
public static String removeSpecialChar(String s)
{
try
{
s=s.replaceAll("&","& amp ;");
s=s.replaceAll("<" , " & lt ;");
s=s.replaceAll(">", "& gt ;");
s=s.replaceAll("'", "& apos ;");
s=s.replaceAll("\"", "& quot ;");
}
catch(Exception e)
{
e.printStackTrace();
}
return s;
}
Please remove spaces between characters within double quotes. I have added them because otherwise you can't see this code properly. Please check this below link , please replace the characters with proper values as the display is causing a problem here
http://support.microsoft.com/kb/316063
regards
Anupam
Edited by: anupamsap on Jul 7, 2011 4:22 PM
Edited by: anupamsap on Jul 7, 2011 4:23 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> Is there any way to configure content conversion to remove control characters which are not allowed in XML? Unfortunately the sender system cannot be modified
Content conversion does not remove special characters. You can write simpe UDF to remove special characters in the mapping. That is the feasible option.
Use java method replaceAll or replace() to achieve this.
Refer this [link |http://www.roseindia.net/java/string-examples/string-replaceall.shtml]for sample
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try to remove special characters in mapping...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Probably you can use a java mapping to replace the control characters in mapping, as discussed in this blog-
/people/community.user/blog/2008/05/05/implementing-a-java-mapping-in-sap-pi-to-remove-escape-sequences-from-a-file
Regards,
Francis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.