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('pzmodel');
0017
0018
0019
0020
0021 elcc = xml.docNode.createElement('name');
0022 elcc.appendChild(xml.docNode.createTextNode(get(p,'name')));
0023 elc.appendChild(elcc);
0024
0025
0026 elcc = xml.docNode.createElement('gain');
0027 elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'gain'))));
0028 elc.appendChild(elcc);
0029
0030
0031 xml = xmladd(p.created, xml, 'created', elc);
0032
0033
0034 elcc = xml.docNode.createElement('version');
0035 elcc.appendChild(xml.docNode.createTextNode(p.version));
0036 elc.appendChild(elcc);
0037
0038
0039 ps = get(p,'poles');
0040 if ~isempty(ps)
0041 xml = xmladd(ps, xml, 'poles', elc);
0042 end
0043
0044
0045 ps = get(p,'zeros');
0046 if ~isempty(ps)
0047 xml = xmladd(ps, xml, 'zeros', elc);
0048 end
0049 el.appendChild(elc);
0050 end
0051
0052 node.appendChild(el);
0053
0054
0055
0056