0001 function po = fromxml(xml)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 sch = xml.getChildNodes;
0016 for c=1:sch.getLength
0017 x = sch.item(c-1);
0018 switch char(x.getNodeName)
0019 case 'version'
0020 p.version = char(x.getTextContent);
0021 case 'name'
0022 p.name = char(x.getTextContent);
0023 case 'f'
0024 p.f = str2num(char(x.getTextContent));
0025 case 'q'
0026 p.q = str2num(char(x.getTextContent));
0027 case 'created'
0028 xch = x.getChildNodes;
0029 p.created = time(xch.item(1));
0030 otherwise
0031 end
0032 end
0033
0034
0035 po = zero(p.f, p.q);
0036 po = set(po, 'name', p.name);
0037 po = set(po, 'version', p.version);
0038 po = set(po, 'created', p.created);
0039
0040