source: trunk/src/@xmltree/move.m @ 1053

Last change on this file since 1053 was 925, checked in by sommeria, 9 years ago

xmltree updated

File size: 808 bytes
Line 
1function tree = move(tree,uida, uidb)
2% XMLTREE/MOVE Move (move a subtree inside a tree from A to B)
3%
4% tree   - XMLTree object
5% uida   - initial position of the subtree
6% uidb   - parent of the final position of the subtree
7%__________________________________________________________________________
8%
9% Move a subtree inside a tree from A to B.
10% The tree parameter must be in input AND in output.
11%__________________________________________________________________________
12% Copyright (C) 2002-2015  http://www.artefact.tk/
13
14% Guillaume Flandin
15% $Id: move.m 6480 2015-06-13 01:08:30Z guillaume $
16
17
18%error(nargchk(3,3,nargin));
19
20p = tree.tree{uida}.parent;
21tree.tree{p}.contents(find(tree.tree{p}.contents==uida)) = [];
22tree.tree(uidb).contents = [tree.tree(uidb).contents uida];
Note: See TracBrowser for help on using the repository browser.