on 01-03-2011 9:56 AM
hii experts,
this is shreya.i have a payload from where i need to remove the special characters searching them through their ascii codes.
Please suggest a solution to my problem.
Hi Shreyasen Gupta,
I think this issue not related to character encoding (ascii or UTF-8). It is related to well formed XML.
Please note:- quote ("), apostrophe ('), ampersand (&), less than (<), greater than (>) are special characters in XML. They should not be present in data.
http://www.w3.org/TR/REC-xml/ The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the strings " & " and " < " respectively.
Escape characters u201C " ; , u2018 &apos ; , & amp ; , < < ; , > > ;
Not Well formed XML:
<Name>Raghuu2019s</Name> <Name> Raghu & Vamsee </Name>
Well formed XML:
<Name>Raghu's</Name> <Name>Raghu & Vamsee</Name>
It is very difficult (if not impossible) to escape & and <, to make XML 100 % well formed in PI. Escaping should be done at source side, when XML is getting generated.
If you have no control on sender side, then find out in which element of XML these characters are coming and then write a Java mapping to escape the special characters. This solution will not fix the issue to 100% accuracy, but I feel it is the best available solution. Note, Graphical and XML mapping cannot take Not Well formed XML as input, so they cannot be used.
Regards,
Raghu_Vamsee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why has your payload invalid characters?
Fix the issue in sender system.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hii,
My payload contains some special characters which can not be mend at the sender side, and they have to be delivered as it is to the reciver, but integration engine can not handle the special characters so i need to replace them with something and convert the entire payload to the integration engine specific format.
Again at the reciver side it has to go back in the same format in which receiver has sent it.
shreya
> no the incoming payload is not XML.
> It is an idoc.
So it is a idoc flat file?
> Cant forward it without any transformation becuase integration engine does not support the special character "&" which might be present in my payload.
When you do no mapping, then Integration Engine will not care about the content.
If your incoming payload is not XML, then you cannot do mapping anyway.
Edited by: Stefan Grube on Jan 4, 2011 10:18 AM
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.