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 » Converting XML tag values to tab delimited BLOB

Post new topic  Reply to topic
 Converting XML tag values to tab delimited BLOB « View previous topic :: View next topic » 
Author Message
tdwells
PostPosted: Mon Mar 24, 2003 1:14 pm    Post subject: Converting XML tag values to tab delimited BLOB Reply with quote

Apprentice

Joined: 30 Oct 2002
Posts: 42

Can someone please point me in the right direction. I want to take an incoming XML document and parse the values of certain XML tags into a tab delimited BLOB output node. If possible, I would like to do this using a compute node without any MRM's.

Incoming XML:
<Message>
<PrefixInfo>
<Flag1>True</Flag1>
<Flag2>123</Flag2>
<PrefixInfo>
<Message>

Expected Output:
True<tab>123<tab>

Thanks
_________________
IBM Certified Specialist - MQSeries
Back to top
View user's profile Send private message
mapa
PostPosted: Tue Mar 25, 2003 5:17 am    Post subject: XML -> tab BLOB Reply with quote

Master

Joined: 09 Aug 2001
Posts: 257
Location: Malmö, Sweden

Hi,

The way I'd do it is to use the ability that you now can cast between CHAR and BLOB in a "normal" way, (not going through the hex format).

This code produces what you want, I quickly tested it, and could be written to be more generic perhaps.



Code:

-- Enter SQL below this line.  SQL above this line might be regenerated, causing any modifications to be lost.
-- copy MQMD
SET OutputRoot.MQMD = InputRoot.MQMD;

-- set new Properties
SET OutputRoot.Properties.MessageDomain = 'BLOB';
SET OutputRoot.Properties.MessageSet = '';
SET OutputRoot.Properties.MessageType = '';
SET OutputRoot.Properties.MessageFormat = '';


--DECLARE RFH2_BLOB BLOB;
DECLARE TempChar CHAR;
DECLARE TempBlob BLOB;
DECLARE TAB BLOB;

-- Horizontal tab is hex 09
SET TAB = CAST ('09' AS BLOB);

SET TempChar = InputRoot.XML."Message"."PrefixInfo"."Flag1";
SET TempBlob = CAST(TempChar AS BLOB CCSID InputRoot.MQMD."CodedCharSetId") || TAB;


SET TempBlob = TempBlob || CAST(InputRoot.XML."Message"."PrefixInfo"."Flag2" AS BLOB CCSID InputRoot.MQMD."CodedCharSetId") || TAB;

Set OutputRoot.BLOB.BLOB = TempBlob;


Best regards Mapa
Back to top
View user's profile Send private message Visit poster's website
tdwells
PostPosted: Tue Mar 25, 2003 12:40 pm    Post subject: Reply with quote

Apprentice

Joined: 30 Oct 2002
Posts: 42

Mapa,

Thanks for your reply. With some additional modifications, it worked great. Thanks.

Regards,
Troy
_________________
IBM Certified Specialist - MQSeries
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 » Converting XML tag values to tab delimited BLOB
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.