Home > classes > @zero > xmladd.m

xmladd

PURPOSE ^

XMLADD add a zero object to the given node of the input XML DOM

SYNOPSIS ^

function xml = xmladd(ps, xml, nodename, node)

DESCRIPTION ^

 XMLADD add a zero object to the given node of the input XML DOM
 object.

 M Hewitson 14-02-07

 $Id: xml_add_pole.m,v 1.3 2007/07/30 12:13:10 ingo Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function xml = xmladd(ps, xml, nodename, node)
0002 
0003 % XMLADD add a zero object to the given node of the input XML DOM
0004 % object.
0005 %
0006 % M Hewitson 14-02-07
0007 %
0008 % $Id: xml_add_pole.m,v 1.3 2007/07/30 12:13:10 ingo Exp $
0009 %
0010 
0011 el = xml.docNode.createElement(nodename);
0012 
0013 %       p.name    = 'real pole';
0014 %       p.f       = varargin{1};
0015 %       p.q       = -1;
0016 %       p.ri      = p.f;
0017 %       p.version = VERSION;
0018 
0019 for j=1:length(ps)
0020   p = ps(j);
0021 
0022   % Add pole object
0023   elc = xml.docNode.createElement('zero');
0024 
0025   % add name
0026   elcc = xml.docNode.createElement('name');
0027   elcc.appendChild(xml.docNode.createTextNode(get(p, 'name')));
0028   elc.appendChild(elcc);
0029 
0030   % add version
0031   elcc = xml.docNode.createElement('version');
0032   elcc.appendChild(xml.docNode.createTextNode(get(p, 'version')));
0033   elc.appendChild(elcc);
0034 
0035   % add f
0036   elcc = xml.docNode.createElement('f');
0037   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'f'))));
0038   elc.appendChild(elcc);
0039 
0040   % add Q
0041   elcc = xml.docNode.createElement('q');
0042   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'q'))));
0043   elc.appendChild(elcc);
0044 
0045   el.appendChild(elc);
0046 end
0047 
0048 node.appendChild(el);
0049 
0050

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003