Last change
on this file since 731 was
723,
checked in by sommeria, 11 years ago
|
xmltree and toolbox_calib added to svn
|
File size:
795 bytes
|
Rev | Line | |
---|
[723] | 1 | function 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 | |
---|
| 14 | error(nargchk(2,2,nargin)); |
---|
| 15 | |
---|
| 16 | child = []; |
---|
| 17 | uid = uid(:); |
---|
| 18 | l = length(tree); |
---|
| 19 | for 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 |
---|
| 27 | end |
---|
| 28 | if isempty(child), child = []; end |
---|
Note: See
TracBrowser
for help on using the repository browser.