comparison m-toolbox/classes/@minfo/fromDom.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 obj = fromDom(obj, node, inhists)
3
4 % there exist some possibilities.
5 %
6 % first (only one minfo-object with no children):
7 % <parent methodInfo="#abs#ao#operator#(id):..."/>
8 %
9 % second (more than one minfo with no children)
10 % <parent>
11 % <minfo shape="1x2" methodInfo="#abs#ao#operator#(id):..."/>
12 % <minfo shape="1x2" methodInfo="#sin#ao#operator#(id):..."/>
13 % </parent>
14 %
15 % third
16 % <parent>
17 % <minfo shape="1x1" methodInfo="#abs#ao#operator#(id):...">
18 % <minfo shape="1x2" methodInfo="#child11#ao#operator#(id):..."/>
19 % <minfo shape="1x2" methodInfo="#child12#ao#operator#(id):..."/>
20 % </minfo>
21 % </parent>
22 %
23
24 if node.hasAttribute('methodInfo')
25
26 %%%%%%%%%% Call super-class
27
28 fromDom@ltpda_nuo(obj, node, inhists);
29
30 % get encoded string
31 info = utils.xml.mchar(node.getAttribute('methodInfo'));
32
33 obj = minfo.setFromEncodedInfo(obj, info);
34
35 % check if there are some children if the node name is 'minfo'
36 nodeName = utils.xml.mchar(node.getNodeName);
37 if strcmp(nodeName, 'minfo')
38 obj.children = utils.xml.getObject(node, inhists);
39 end
40
41 else
42
43 % get shape
44 objshape = utils.xml.getShape(node);
45
46 if any(objshape==0)
47
48 obj = minfo.initObjectWithSize(objshape(1), objshape(2));
49
50 else
51
52 %%%%%%%%%% get minfo objects from child nodes
53 obj = utils.xml.getObject(node, inhists);
54 end
55
56 end
57 end
58