comparison m-toolbox/classes/@minfo/attachToDom.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1
2 function collectedHist = attachToDom(objs, dom, parent, collectedHist)
3
4 if isempty(objs)
5
6 % Create empty minfo node with the attribute 'shape'
7 utils.xml.attachEmptyObjectNode(objs, dom, parent);
8
9 else
10 for oo = 1:numel(objs)
11
12 obj = objs(oo);
13
14 % Create object node
15 minfoNode = dom.createElement('minfo');
16 minfoNode.setAttribute('shape', sprintf('%dx%d', size(objs)));
17
18 % Add encoded string
19 minfoNode.setAttribute('methodInfo', obj.getEncodedString);
20
21 % Add children
22 if isa(obj.children, 'minfo')
23 % childrenNode = dom.createElement('children');
24 collectedHist = obj.children.attachToDom(dom, minfoNode, collectedHist);
25 % aoNode.appendChild(childrenNode);
26 end
27
28 % Add to parent node
29 parent.appendChild(minfoNode);
30 end
31 end
32
33 end