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 » Deleting Contents of XML Tag

Post new topic  Reply to topic
 Deleting Contents of XML Tag « View previous topic :: View next topic » 
Author Message
gowdy
PostPosted: Thu Sep 20, 2001 1:29 am    Post subject: Reply with quote

Apprentice

Joined: 17 Jul 2001
Posts: 29
Location: Bournemouth, UK

Hi

I have a message with the following structure:
<mainTag>
<secondLevel>
<newMsg>
<one></one>
<two></two>
</newMsg>
</secondLevel>
</mainTag>
Now, what I want to do is set the contents of <secondLevel> to be empty, ie have the following structure:
<mainTag>
<secondLevel></secondLevel>
</mainTag>

If I say SET OutputRoot.XML.mainTag.secondLevel = '';
then it does not appear to work properly. I set it to be 'TEST' and this was appended to the end of the <secondLevel> tag.

Is there any easy way to delete the contents of a tag which contains further tags?

Thanks

Mark


[ This Message was edited by: gowdy on 2001-09-20 02:51 ]
Back to top
View user's profile Send private message Send e-mail
kolban
PostPosted: Thu Sep 20, 2001 5:46 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

In a compute node, I think if you set the SecondLevel entry to NULL and then set it again after that to '' you will acheive what you are after.

e.g.


SET OutputRoot.XML.MainTag.SecondLevel = NULL;
SET OutputRoot.XML.MainTag.SecondLevel = '';


[ This Message was edited by: kolban on 2001-09-20 06:47 ]
Back to top
View user's profile Send private message
gowdy
PostPosted: Thu Sep 20, 2001 6:00 am    Post subject: Reply with quote

Apprentice

Joined: 17 Jul 2001
Posts: 29
Location: Bournemouth, UK

Hi

I had tried that one, but it appears you cannot delete all the sub-children easily. What I did was:
DECLARE I INTEGER;
SET I = 1;
WHILE I <= CARDINALITY(OutputRoot.XML.Main.SecondLevel.*[]) DO
SET OutputRoot.XML.Main.SecondLevel.*[1] = NULL;
END WHILE;

This seems to work quite well.

Thanks

Mark
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Deleting Contents of XML Tag
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.