|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
suggestions for xml to mrm conversion |
« View previous topic :: View next topic » |
Author |
Message
|
ramires |
Posted: Wed Jul 24, 2002 8:38 am Post subject: suggestions for xml to mrm conversion |
|
|
Knight
Joined: 24 Jun 2001 Posts: 523 Location: Portugal - Lisboa
|
Hi Forum
I need some suggestions on how to convert data from a xml format to cwf format. The dificulties are related with the xml tags in the input message. For example, having this input message:
<tg1>aa</tg1><tg2>bb</tg2><tg3>1</tg3><tg4>dd</tg4>
(this is a very simple example) I need to convert it to:
12#aa#bb#1#dd# where 12 is to length of data, # delimiter
This is simple, but my problem is because tg4 is only present if tg3 has value "1", and I have some other variations.
If the input message is:
<tg1>aa</tg1><tg2>bb</tg2><tg3>0</tg3>
the output is something like: 7#aa#bb#.
I was reading some samples and the documentation about this kind of variable input/output messages, and to be honest I think i'm lost.
Some pointers would be great. Thanks !
joao |
|
Back to top |
|
 |
Miriam Kaestner |
Posted: Thu Jul 25, 2002 12:57 am Post subject: |
|
|
Centurion
Joined: 26 Jun 2001 Posts: 103 Location: IBM IT Education Services, Germany
|
I am not sure if I understood your problem. CWF might not be the right OutputFormat - if your fields are variable length with delimiters, you should use a Tagged-delimited physical format.
Fields tg3 and tg4 should be defined as optional. But, if these fields are not the very last fields in the message, your receiving application will have problems parsing it.
You will need some ESQL for the logic to fill the output message, e.g.
-- copy headers only
SET OutputRoot.MRM.tglength=0;
SET OutputRoot.MRM.tg.tg1=InputBody.Msg.tg1;
SET OutputRoot.MRM.tg.tg2=InputBody.Msg.tg2;
IF InputBody.Msg.tg3=1 THEN
SET OutputRoot.MRM.tg.tg3=InputBody.Msg.tg3;
SET OutputRoot.MRM.tg.tg4=InputBody.Msg.tg4;
END IF;
SET OutputRoot.MRM.tglength=LENGTH(BITSTREAM(OutputRoot.MRM.tg))); |
|
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
|
|
|
|