|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Deleting Contents of XML Tag |
« View previous topic :: View next topic » |
Author |
Message
|
gowdy |
Posted: Thu Sep 20, 2001 1:29 am Post subject: |
|
|
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 |
|
 |
kolban |
Posted: Thu Sep 20, 2001 5:46 am Post subject: |
|
|
 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 |
|
 |
gowdy |
Posted: Thu Sep 20, 2001 6:00 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|