on 01-08-2007 12:34 PM
Hi All
I receive a string with a & from a 3rd Party. This seems to crash the mapping on XI.
The type is currently defined as a 'String', and works perfectly for all strings - just a problem when the string contains a '&'.
Thanks in advance
Clinton
Good help from fellow XI'ers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Clinton,
the received XML is not any longer well formed if including a "&". You need a CDATA element like:
<![CDATA[&]]>
, to pass it through a XML parser. For that reason you can put an not parsing ABAP mapping in front of the interface mapping, which will substitute the "&". Use FM ECATT_CONV_XSTRING_TO_STRING to have string, REPLACE the '&' and use FM ECATT_CONV_STRING_TO_XSTRING to have a XSTRING for the result. If your mapping is XSL you can use attribute <i>disable-output-escaping="yes"</i> of "<i>value-of</i>" to get the CDATA value.
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Clinton,
you can achieve that by a java mapping (like stefan recommended) or by abap. Create a <a href="http://help.sap.com/saphelp_nw04/helpdata/en/10/5abb2d9df242f6a62e22e027a6c382/frameset.htm">ABAP Mapping</a>, transform the source to string, replace
REPLACE '&' WITH '<![CDATA[&' INTO mystring.]]>
and transform the result to Xstring. Be careful to replace only the right (better wrong) &. Transform with the FM i told you. Put the abap mapping in front of the if mapping. You can send the CDATA - if receiving application is pleasured or map it with XSL like i told you. To read the CDATA should be possible with any other mapping program (but i made it easy with XSL).
Regards,
Udo
Hi,
what is the problem?
roberti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
The following XML is what I get from the 3rd Party.
=============================================
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Request Message Mapping
-->
- <MT_Metallurgical_Approval_Prcess xmlns="http://lonmin.co.za/MetallurgicalApprovalProcess" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <Process xmlns="">
<ProcessID>0</ProcessID>
<ProcessName>data</ProcessName>
<DataSetCategory>data</DataSetCategory>
<DataSetLogTime>data</DataSetLogTime>
<CurrentStageName>data</CurrentStageName>
<ViewURL><b>http://addres/PARS1/NoMenu.aspx?tab=7&procid=0&iindex=0</b></ViewURL>
<ClearFlag>true</ClearFlag>
</Process>
</MT_Metallurgical_Approval_Prcess>
============================================
The ViewURL that I receive crashes the mapping. If I change the ViewURL string to <ViewURL><b>http://addres/PARS1/NoMenu.aspx?tab=7procid=0iindex=0</b></ViewURL> this is the string without the '&'.
Hope this makes sense
Thanks
Clinton
User | Count |
---|---|
93 | |
10 | |
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.