Home > classes > @mfir > xmladd.m

xmladd

PURPOSE ^

XMLADD add an MFIR object to the given node of the input XML DOM

SYNOPSIS ^

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

DESCRIPTION ^

 XMLADD add an MFIR object to the given node of the input XML DOM
 object.

 M Hewitson 14-02-07

 $Id: xml_add_miir.m,v 1.6 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 an MFIR object to the given node of the input XML DOM
0004 % object.
0005 %
0006 % M Hewitson 14-02-07
0007 %
0008 % $Id: xml_add_miir.m,v 1.6 2007/07/30 12:13:10 ingo Exp $
0009 %
0010 el = xml.docNode.createElement(nodename);
0011 
0012 for j=1:length(ps)
0013   p = ps(j);
0014   elc = xml.docNode.createElement('mfir');
0015 
0016 
0017   % add version
0018   elcc = xml.docNode.createElement('version');
0019   elcc.appendChild(xml.docNode.createTextNode(get(p,'version')));
0020   elc.appendChild(elcc);
0021 
0022   % add name
0023   elcc = xml.docNode.createElement('name');
0024   elcc.appendChild(xml.docNode.createTextNode(get(p,'name')));
0025   elc.appendChild(elcc);
0026 
0027   % add created
0028   xml = xmladd(get(p, 'created'), xml, 'created', elc);
0029 
0030   % add fs
0031   elcc = xml.docNode.createElement('fs');
0032   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'fs'))));
0033   elc.appendChild(elcc);
0034 
0035   % add ntaps
0036   elcc = xml.docNode.createElement('ntaps');
0037   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'ntaps'))));
0038   elc.appendChild(elcc);
0039 
0040   % add gain
0041   elcc = xml.docNode.createElement('gain');
0042   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'g'))));
0043   elc.appendChild(elcc);
0044 
0045   % add infile
0046   elcc = xml.docNode.createElement('infile');
0047   elcc.appendChild(xml.docNode.createTextNode(get(p,'infile')));
0048   elc.appendChild(elcc);
0049 
0050   % add plist
0051   pl = get(p,'plist');
0052   if isa(pl, 'plist')
0053     xml = xmladd(pl, xml, 'plist', elc);
0054   end
0055 
0056   % add a
0057   a = get(p,'a');
0058   elcc = xml.docNode.createElement('a');
0059   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(a)));
0060   elc.appendChild(elcc);
0061 
0062   % add histout
0063   oh = get(p, 'histout');
0064   elcc = xml.docNode.createElement('histout');
0065   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(oh)));
0066   elc.appendChild(elcc);
0067 
0068   el.appendChild(elc);
0069 end
0070 node.appendChild(el);
0071 
0072 
0073 
0074 % END

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