on 09-25-2008 3:31 PM
Hi XI/PI Experts
Hope you are able to help me out in this matter, as I´m starting to loose my hair over this problem
I have a mapping from a ARTMAS04 idoc to a XML, which works fine. The problem is that the receiver application of the XML requires CDATA sections for two of the fields in the output structure.
If I just add the CDATA tags directly in my message mapping, XI will convert the output source such as the CDATA start "<![CDATA[", is represented as "<![CDATA[". I guess this is because the fields are beeing represented as Strings.
To overcome this problem I created a JAVA mapping which takes the output from my MM and add CDATA sections to the two fields using the Dom4J class. The solution works fine when I am testing it in my Interface Mapping, but when I view the source on the XML in SXMB_MONI, it still looks like "<![CDATA["
How can I keep the CDATA sections without XI translating them?
Any answer is appreciated.
Best regards
Chris
Hi mates, this problem it's now solved, i forgot to xplain the solution. The solution has been a java function in the mapping to split each field whit the according data structure, if u need more info, please, contact whit this forum.
Best regards and thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Will you please let me know what function did you use to replace encoded chanracters "<".I dont find this in SXMB_MONI or chanel monitoing until unless i open with notepad or viewsource.I just used constant in my mapping and concat to achive the CDATA structure.Please let me know how did u fix this issue.I tried with intermediate mapping and UDF and replace string however in the mapping results when i open using 'src' button i can see < but not with normal tabular tree view.Your suggestion will be appreciated.
Thanks
Pawan
This UDF will help you...
//write your code here
StringBuffer result=new StringBuffer();
char[] splChar= {'!','#','$','%','&','<','>'};
int length=splChar.length;
int splCharFound=0;
int i;
for(i=0;i<length;i++)
{
if(input.indexOf(splChar<i>)!=-1)
{ splCharFound=1;
break; // the control comes out even if ther is one Spl Charr
}
}
if(splCharFound==1) //if the String contains Special Characters
{
result.append("<![CDATA[");
result.append(input);
result.append("]]>");
return result.toString();
}
else //if the input doesnt contain any spl character
{
return input;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
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.