comparison m-toolbox/classes/@matrix/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 matrix node with the attribute 'shape'
7 utils.xml.attachEmptyObjectNode(objs, dom, parent);
8
9 else
10 for oo = 1:numel(objs)
11 obj = objs(oo);
12
13 % Create object node
14 matrixNode = dom.createElement('matrix');
15 matrixNode.setAttribute('shape', sprintf('%dx%d', size(objs)));
16
17 % Call superclass
18 collectedHist = attachToDom@ltpda_uoh(obj, dom, matrixNode, collectedHist);
19
20 % Add objs
21 if isa(obj.objs, 'ltpda_obj')
22 objsNode = dom.createElement('objs');
23 collectedHist = obj.objs.attachToDom(dom, objsNode, collectedHist);
24 matrixNode.appendChild(objsNode);
25 end
26
27 % Add to parent node
28 parent.appendChild(matrixNode);
29
30 end
31 end
32
33 end