source: trunk/src/@xmltree/children.m @ 728

Last change on this file since 728 was 723, checked in by sommeria, 11 years ago

xmltree and toolbox_calib added to svn

File size: 795 bytes
Line 
1function child = children(tree,uid)
2% XMLTREE/CHILDREN Return children's UIDs of node uid
3% FORMAT child = children(tree,uid)
4%
5% tree   - a tree
6% uid    - uid of the element
7% child  - array of the UIDs of children of node uid
8%_______________________________________________________________________
9%
10% Return UID's of children of node uid
11%_______________________________________________________________________
12% @(#)children.m              Guillaume Flandin                02/04/09
13
14error(nargchk(2,2,nargin));
15
16child = [];
17uid = uid(:);
18l = length(tree);
19for i=1:length(uid)
20        if uid(i) > 0 & uid(i) <= l
21                if strcmp(tree.tree{uid(i)}.type,'element')
22                        child = [child tree.tree{uid(i)}.contents];
23                end
24        else
25                error('[XMLTree] Invalid UID.');
26        end
27end
28if isempty(child), child = []; end
Note: See TracBrowser for help on using the repository browser.