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 IndexWebSphere Message Broker SupportHow can I remove the tags from an XML message

Post new topicReply to topic
How can I remove the tags from an XML message View previous topic :: View next topic
Author Message
KittieKat
PostPosted: Tue Dec 18, 2001 4:21 pm Post subject: Reply with quote

Apprentice

Joined: 17 Dec 2001
Posts: 31

Does anyone know how to strip the tags off an XML message leaving only the text field as the output? For example, the input message is Honda and I just want to output the word "Honda". I tried to use the BLOB parser in the Compute Node, somehow it didn't recognize the parser. please help, thanks.
Back to top
View user's profile Send private message Send e-mail
KittieKat
PostPosted: Tue Dec 18, 2001 4:23 pm Post subject: Reply with quote

Apprentice

Joined: 17 Dec 2001
Posts: 31

oops, the input message should be "Honda".
Back to top
View user's profile Send private message Send e-mail
KittieKat
PostPosted: Tue Dec 18, 2001 4:25 pm Post subject: Reply with quote

Apprentice

Joined: 17 Dec 2001
Posts: 31

The input message is the word Honda preceded by an opening tag "car" and a closing tag "car". Sorry about that.
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Tue Dec 18, 2001 5:11 pm Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Firstly, disable HTML and then the tags will show correctly in the forum.

Can you describe the output record format in the MRM. If so, then use ESQL to move each field from the XML to it's corresponding MRM field.

If you can't do it in the MRM, then you will have to do it using NEON formats, as they are more flexible as far as record format go.

Cheers,

_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
WBI_user
PostPosted: Tue Dec 18, 2001 9:28 pm Post subject: Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

This will do the trick for an XML with begin tag and end tag of MESSAGE
<MESSAGE>.......</MESSAGE>
I got the help from a PMR that I reported.
DECLARE len_starttag INTEGER;
DECLARE len_endtag INTEGER;
DECLARE work BLOB;
DECLARE len_work INTEGER;
DECLARE result BLOB;
DECLARE len_result INTEGER;
-- <MESSAGE>
SET len_starttag = LENGTH(x'3C4D4553534147453E');
-- </MESSAGE>
SET len_endtag = LENGTH(x'3C2F4D4553534147453E');
SET work = BITSTREAM(InputRoot.XML."MESSAGE");
SET len_work = LENGTH(work);
SET len_result = len_work - (len_starttag + len_endtag);
SET result = SUBSTRING(work FROM (len_starttag+1) FOR len_result);

SET OutputRoot."BLOB"."BLOB" = result;
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportHow can I remove the tags from an XML message
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.