0001 function xml = xmladd(ps, xml, nodename, node)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 el = xml.docNode.createElement(nodename);
0012
0013 for j=1:length(ps)
0014 p = ps(j);
0015
0016 elc = xml.docNode.createElement('param');
0017
0018
0019 elcc = xml.docNode.createElement('version');
0020 elcc.appendChild(xml.docNode.createTextNode(p.version));
0021 elc.appendChild(elcc);
0022
0023
0024 elcc = xml.docNode.createElement('key');
0025 elcc.appendChild(xml.docNode.createTextNode(p.key));
0026 elc.appendChild(elcc);
0027
0028
0029 if ischar(p.val)
0030 elcc = xml.docNode.createElement('value');
0031 elcc.appendChild(xml.docNode.createTextNode(p.val));
0032 elc.appendChild(elcc);
0033 elseif isnumeric(p.val)
0034 elcc = xml.docNode.createElement('value');
0035 elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(p.val)));
0036 elc.appendChild(elcc);
0037 else
0038 xml = xmladd(p.val, xml, 'value', elc);
0039 end
0040
0041 el.appendChild(elc);
0042 end
0043
0044 node.appendChild(el);
0045
0046
0047
0048