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: xmladd.html,v 1.6 2008/02/12 12:18:03 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 an MFIR 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:18:03 hewitson 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 name
0018   elcc = xml.docNode.createElement('name');
0019   elcc.appendChild(xml.docNode.createTextNode(get(p,'name')));
0020   elc.appendChild(elcc);
0021 
0022   % add fs
0023   elcc = xml.docNode.createElement('fs');
0024   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'fs'))));
0025   elc.appendChild(elcc);
0026 
0027   % add ntaps
0028   elcc = xml.docNode.createElement('ntaps');
0029   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'ntaps'))));
0030   elc.appendChild(elcc);
0031 
0032   % add a
0033   a = get(p,'a');
0034   elcc = xml.docNode.createElement('a');
0035   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(a)));
0036   elc.appendChild(elcc);
0037 
0038   % add a
0039   a = get(p,'gd');
0040   elcc = xml.docNode.createElement('gd');
0041   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(a)));
0042   elc.appendChild(elcc);
0043 
0044   % add gain
0045   elcc = xml.docNode.createElement('gain');
0046   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'gain'))));
0047   elc.appendChild(elcc);
0048 
0049   % add histout
0050   oh = get(p, 'histout');
0051   elcc = xml.docNode.createElement('histout');
0052   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(oh)));
0053   elc.appendChild(elcc);
0054 
0055   % add infile
0056   elcc = xml.docNode.createElement('infile');
0057   elcc.appendChild(xml.docNode.createTextNode(get(p,'infile')));
0058   elc.appendChild(elcc);
0059 
0060   % add plist
0061   pl = get(p,'plist');
0062   if isa(pl, 'plist')
0063     xml = xmladd(pl, xml, 'plist', elc);
0064   end
0065 
0066   % add created
0067   xml = xmladd(get(p, 'created'), xml, 'created', elc);
0068 
0069   % add version
0070   elcc = xml.docNode.createElement('version');
0071   elcc.appendChild(xml.docNode.createTextNode(get(p,'version')));
0072   elc.appendChild(elcc);
0073 
0074   el.appendChild(elc);
0075 end
0076 node.appendChild(el);
0077 
0078 
0079 
0080 % END

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