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 » getting tree reference from a procedure

Post new topic  Reply to topic
 getting tree reference from a procedure « View previous topic :: View next topic » 
Author Message
sat_in_field
PostPosted: Thu Dec 02, 2004 4:04 am    Post subject: getting tree reference from a procedure Reply with quote

Novice

Joined: 23 Jan 2003
Posts: 20

Hello,
I found some code by Craig B to navigate recursivly through an unknown xml tree to find a tag, http://www.mqseries.net/phpBB2/viewtopic.php?t=10065&highlight=lastmove+procedure. I have changed this a little to search for specific content of a tag in an unknown tree. The trace shows that this is working. However I need to return the reference from the procedure so that I can continue processing the data(parse the embedded swift). So far I have not been able to do this, does anyone have a possible solution? My code is below, please note that at present to quicky validate the success/failure i am just testing the FIELDNAME of the reference.

Many Thanks

Code:
DECLARE foundMatch BOOLEAN FALSE;
DECLARE OutboundMsg REFERENCE TO InputRoot.XML.TPCIMessage.OutboundMessage;

CALL navigate (OutboundMsg,  foundMatch, '{1:');

IF foundMatch = TRUE THEN
   SET OutputRoot.XML.TPCIMessage.Tag = FIELDNAME(OutboundMsg);
END IF;

CREATE PROCEDURE navigate (INOUT OutboundMsg REFERENCE, INOUT foundMatch BOOLEAN, IN searchText CHAR)
BEGIN
   DECLARE MatchingPattern CHARACTER;
   DECLARE cursor REFERENCE TO OutboundMsg;
   SET MatchingPattern = SUBSTRING(OutboundMsg FROM 1 FOR 3);
   MOVE cursor FIRSTCHILD;
   IF LASTMOVE(cursor) THEN
   ELSE
      IF MatchingPattern = searchText THEN
         SET foundMatch = TRUE;
      END IF;
   END IF;
   WHILE LASTMOVE(cursor) AND (foundMatch = FALSE) DO
       CALL navigate(cursor, foundMatch, searchText);
       MOVE cursor NEXTSIBLING;
   END WHILE;
END;
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Dec 02, 2004 11:45 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

These posts might help,
http://www.mqseries.net/phpBB2/viewtopic.php?t=10595&highlight=reference
http://www.mqseries.net/phpBB2/viewtopic.php?t=17793&highlight=reference
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » getting tree reference from a procedure
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.