Home > classes > @pole > xmladd.m

xmladd

PURPOSE ^

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

SYNOPSIS ^

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

DESCRIPTION ^

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

 M Hewitson 14-02-07

 $Id: xmladd.html,v 1.6 2008/02/12 12:17:51 hewitson 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 pole object to the given node of the input XML DOM
0004 % object.
0005 %
0006 % M Hewitson 14-02-07
0007 %
0008 % $Id: xmladd.html,v 1.6 2008/02/12 12:17:51 hewitson 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('pole');
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 Created
0031   xml = xmladd(p.created, xml, 'created', elc);
0032 
0033   % add version
0034   elcc = xml.docNode.createElement('version');
0035   elcc.appendChild(xml.docNode.createTextNode(get(p, 'version')));
0036   elc.appendChild(elcc);
0037 
0038   % add f
0039   elcc = xml.docNode.createElement('f');
0040   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'f'))));
0041   elc.appendChild(elcc);
0042 
0043   % add Q
0044   elcc = xml.docNode.createElement('q');
0045   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'q'))));
0046   elc.appendChild(elcc);
0047 
0048   el.appendChild(elc);
0049 end
0050 
0051 node.appendChild(el);
0052 
0053

Generated on Tue 12-Feb-2008 13:12:45 by m2html © 2003