on 01-19-2009 4:09 PM
Hi,
I'm currently using Message mapping from cXML to idoc and vice versa. I need a remove the DOCTYPE declaration on the inbound cXML and add DOCTYPE for outbound. I understand, it is possible to have a JAVA mapping or XSLT to resolve this problem, since i'm not expert in Java. Can someone send me a Java code which could help me resolve this issue. Any ideas or help is greatly appreciated.
Thanks!.
Hi Ganesh,
i think most easy would be ABAP:
Do not parse the message, just call a fm to convert to string:
DATA:
* xml message
l_message TYPE string.
*create a string to search (and replace) in it
CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
EXPORTING
im_xstring = source
im_encoding = 'UTF-8'
IMPORTING
ex_string = l_message.
Then use the right string operation for example REPLACE:
REPLACE FIRST OCCURRENCES OF
'<!DOCTYPE...'
IN
l_message
WITH
''.
Finally switch back to XString:
* create a XString: Ready, no use of DOM!
CALL FUNCTION 'ECATT_CONV_STRING_TO_XSTRING'
EXPORTING
im_string = l_message
im_encoding = 'UTF-8'
IMPORTING
ex_xstring = result.
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 Udo.
Thanks for the info. However it does not solve my problem. I'm using standard message mapping on invbound and outbound transformation. I tried to write a JAVA or XSL mapping and use it interface mapping before the actual transformation but im facing issues since im not a java expert Please advise how can i use the ABAP mapping you have provided in this scenario
Thanks!
Hi Ganesh,
>However it does not solve my problem
I think it does. Just add this abap mapping to your interface mapping. It has only one task: Change the payload (delete or add the DTD reference) WITHOUT parsing (because much easier).
Please have a look to sap.help for allowing ABAP mappings at all: (2 important points: set that referred exchange profile parameter and create a ABAP class implementing the interface IF_MAPPING): [Mapping Development with the ABAP Workbench|http://help.sap.com/saphelp_nw2004s/helpdata/en/10/5abb2d9df242f6a62e22e027a6c382/frameset.htm]
Regards,
Udo
Thanks Udo! your suggestion was the easiet , but i was forced to use java mapping to remove the DOCTYPE and XSL to add doctype, however i got the issue resolved.
In our XI, ABAP mapping is not enabled and i have jump hoops to get that enabled by basis. since i dont have necessary authorization to get it done.
Thanks for all your help.
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.