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 » how to split message which contains two xml root tag element

Post new topic  Reply to topic
 how to split message which contains two xml root tag element « View previous topic :: View next topic » 
Author Message
PRKUMAR
PostPosted: Tue Feb 19, 2013 11:25 pm    Post subject: how to split message which contains two xml root tag element Reply with quote

Apprentice

Joined: 04 Sep 2012
Posts: 36

Hi,
Following is the input message structure:
Code:

<MasterHeader>
--
--
</MasterHeader>
<MasterHeader>
--
--
</MasterHeader>

So I am parsing the input message on MQInput node as BLOB since XMLNSC parser doens't support to parse an XML message with two root elements as per standard. In the next compute node, I am using the following code to convert blob data into char.
Code:

SET Environment.Variables.InputMsg = CAST(InputRoot.BLOB.BLOB AS CHAR CCSID InputRoot.Properties.CodedCharsetId);

From the environment variable: InputMsg, how do I split the whole input message into two separate messages like below:
Code:

<MasterHeader>...</MasterHeader>  -- 1st message
<MasterHeader>...</MasterHeader>  -- 2nd message

Please help me how effectively we can implement this. One option I can think of is by taking positions of </MasterHeader> and code accordingly. Is there any other simpler ways to achieve this?
Back to top
View user's profile Send private message
adubya
PostPosted: Wed Feb 20, 2013 12:11 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

You could wrap the data up with your own root tag and then change to XMLNSC domain (RCD node) to parse the now child MasterHeader elements out.

So have a compute node which produces


Code:

<MasterRoot>
<MasterHeader>
--
--
</MasterHeader>
<MasterHeader>
--
--
</MasterHeader>
</MasterRoot>



feed this into a RCD node, change to XMLNSC and then into a compute node to split the data.
Back to top
View user's profile Send private message Send e-mail
PRKUMAR
PostPosted: Wed Feb 20, 2013 12:32 am    Post subject: Reply with quote

Apprentice

Joined: 04 Sep 2012
Posts: 36

Thanks adubya..Will check it now as you specified
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » how to split message which contains two xml root tag element
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.