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 » List[] = NULL;

Post new topic  Reply to topic
 List[] = NULL; « View previous topic :: View next topic » 
Author Message
EnOne
PostPosted: Tue Jan 04, 2005 10:20 am    Post subject: List[] = NULL; Reply with quote

Centurion

Joined: 09 Oct 2002
Posts: 100
Location: Kansas City

Other than looping is there an easier way to remove repeating elements?

Input
<Parent>
<One>1</One>
<Child>
<Two>2</Two>
</Child>
<Child>
<Two>2</Two>
</Child>
<Child>
<Two>2</Two>
</Child>
<Three>3</Three>
</Parent>

Output
<Parent>
<One>1</One>
<Three>3</Three>
</Parent>

ESQL
SET OutputRoot = InputRoot;
DECLARE X INT;
SET X = CARDINALITY(Root.Parent.Child[]);
WHILE X >= 1 DO
SET OutputRoot.XML.Parent.Child[X] = NULL;
SET X = X - 1;
END WHILE;
Back to top
View user's profile Send private message
martinrydman
PostPosted: Tue Jan 04, 2005 10:37 am    Post subject: Reply with quote

Centurion

Joined: 30 Jan 2004
Posts: 139
Location: Gothenburg, Sweden

You could set Parent to NULL and then, if you still want the Parent element, reinsert it with some suitable statement, either by setting it directly:
Code:

SET OutputRoot.XML.Parent.XXX = Something


which will place it as the last element or else, use CREATE statement to insert it somewhere else

Good luck!

/Martin
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 04, 2005 10:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wbihelp/index.jsp?topic=/com.ibm.etools.mft.doc/ak05000_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wmqiguy
PostPosted: Wed Jan 05, 2005 6:16 am    Post subject: Reply with quote

Centurion

Joined: 09 Oct 2002
Posts: 145
Location: Florida

Here's a slighlty different angle. (A variation of martinrydman's answer.)

You are copying the whole tree and then deleting a whole bunch of it. You might want to consider just copying the message headers and then assigning just the couple of values you need to the output tree.
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 » List[] = NULL;
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.