|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
CDATA! |
« View previous topic :: View next topic » |
Author |
Message
|
mqbrk_newbie |
Posted: Thu Nov 18, 2004 1:09 pm Post subject: CDATA! |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
HI,
I am doing a message flow conversion of MRM to XML. After I convert the input copybook definitions to XML , there is one more adapter which will call two applications (COBOL and WEB Application). So I need to send some part of ouput XML in CDATA so that the adapter can directly take that part of xml output and invoke the COBOL application. For example if I have got an input copybook definitions as
01 MESSAGE.
05 HEADER.
10 VERSION PIC 9(04).
10 NAME PIC X(20).
10 ID PIC X(10).
10 INTER-ID PIC X(10).
05 REQ.
10 REQ VAL PIC X(10).
10 USER ID PIC X(06).
10 KEY PIC X(30).
05 BODY.
10 NAME PIC X(30).
10 AGE PIC X(20).
10 PLACE PIC X(20).
10 DOB PIC X(10).
10 STATUS PIC X(06).
I need an output in xml format as...
HEADER>
<VERSION>XXX</VERSION>
<NAME>YYY</NAME>
<ID> ZZ<ID>
</HEADER>
<BODY>
<REQCOPYBOOK>
<![CDATA[(HEADER OF COPYBOOK AND NAME, AGE PLACE,
FROM BODY OF COPYBOOK)]]>
</REQCOPYBOOK>
<DOB>XXX</DOB>
<STATUS>YYY</STATUS>
Can anybody help me out in coding , so that I get only the header part and some body part ( name , age , place) from copybook definitions given above and give XML output as shown above.
Can anyplease please tell me the piece of code for the same.
thanks in advance |
|
Back to top |
|
 |
JT |
Posted: Thu Nov 18, 2004 1:24 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Thu Nov 18, 2004 1:30 pm Post subject: CDATA! |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
JT,
I have already looked at the example which you refered here. I am not sure how to refer only the header and 2 fields from the body of copybook deifinition. can you please write the piece of code here.
thanks |
|
Back to top |
|
 |
JT |
Posted: Thu Nov 18, 2004 2:35 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
I'm not sure if there is a more elegant way to produce the results you want, however something like this should do the trick:
Code: |
SET OutputRoot.XML.ParentTag.BODY.REQCOPYBOOK.(XML.CDataSection) =
CAST(InputRoot.MRM.HEADER.VERSION AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId) || ',' ||
InputRoot.MRM.HEADER.NAME || ',' ||
InputRoot.MRM.HEADER.ID || ',' ||
InputRoot.MRM.HEADER.INTER_ID || ',' ||
InputRoot.MRM.BODY.NAME || ',' ||
InputRoot.MRM.BODY.AGE || ',' ||
InputRoot.MRM.BODY.PLACE; |
|
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Thu Nov 18, 2004 6:02 pm Post subject: cdata! |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
jt,
thanks a lot . i willl try and respond you back
thanks again |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|