ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » suggestions for xml to mrm conversion

Post new topic  Reply to topic
 suggestions for xml to mrm conversion « View previous topic :: View next topic » 
Author Message
ramires
PostPosted: Wed Jul 24, 2002 8:38 am    Post subject: suggestions for xml to mrm conversion Reply with quote

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
View user's profile Send private message
Miriam Kaestner
PostPosted: Thu Jul 25, 2002 12:57 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » suggestions for xml to mrm conversion
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.