How to remove elements from an xml hirarchical structure ?
<root>
<element1>
<many childs>
</element1>
<element2> <=== I want to remove this one
<many childs>
</element2>
<element3>
<many childs>
</element3>
</root>
We have very large xml structures and using "copy header only" and then assigning the needed element one by one is very time consuming. We'd like to use copy "entire message" and then remove one element with childs in an effective way. Overwriting the tree with "LIST {''}" is not our preferred solution.
Thanks for your tips
[ This Message was edited by: Hartmut Grell on 2001-10-19 03:03 ]
Joined: 20 May 2001 Posts: 107 Location: Zurich Financial Services
The easiest way is to NULL out that part of the structure you wish to remove.
So, in your example.....
SET OutputRoot = InputRoot;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.XML.root.element2 = NULL;
This will ensure that element2 (and everything below it) does not get copied forward to the output tree.
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