Home > classes > @ao > private > xml_add_miir.m

xml_add_miir

PURPOSE ^

XML_ADD_MIIR add an MIIR object to the given node of the input XML DOM

SYNOPSIS ^

function xml = xml_add_miir(xml, p, node)

DESCRIPTION ^

 XML_ADD_MIIR add an MIIR object to the given node of the input XML DOM
 object.
 
 M Hewitson 14-02-07
 
 $Id: xml_add_miir.html,v 1.1 2007/06/08 14:15:04 hewitson Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function xml = xml_add_miir(xml, p, node)
0002 
0003 % XML_ADD_MIIR add an MIIR 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.html,v 1.1 2007/06/08 14:15:04 hewitson Exp $
0009 %
0010 el = xml.docNode.createElement('Value');
0011 
0012 elc = xml.docNode.createElement('MIIR');
0013 
0014 if isa(p, 'miir')
0015   
0016   % add version
0017   elcc = xml.docNode.createElement('Version');
0018   elcc.appendChild(xml.docNode.createTextNode(get(p,'version')));
0019   elc.appendChild(elcc);
0020 
0021   % add name
0022   elcc = xml.docNode.createElement('Name');
0023   elcc.appendChild(xml.docNode.createTextNode(get(p,'name')));
0024   elc.appendChild(elcc);
0025   
0026   % add created
0027   elcc = xml.docNode.createElement('Created');
0028   elcc.appendChild(xml.docNode.createTextNode(get(p,'created')));
0029   elc.appendChild(elcc);
0030   
0031   % add fs
0032   elcc = xml.docNode.createElement('Fs');
0033   elcc.appendChild(xml.docNode.createTextNode(num2str(get(p,'fs'))));
0034   elc.appendChild(elcc);
0035   
0036   % add ntaps
0037   elcc = xml.docNode.createElement('Ntaps');
0038   elcc.appendChild(xml.docNode.createTextNode(num2str(get(p,'ntaps'))));
0039   elc.appendChild(elcc);
0040   
0041   % add gain
0042   elcc = xml.docNode.createElement('Gain');
0043   elcc.appendChild(xml.docNode.createTextNode(num2str(get(p,'g'))));
0044   elc.appendChild(elcc);
0045   
0046   % add infile
0047   elcc = xml.docNode.createElement('Infile');
0048   elcc.appendChild(xml.docNode.createTextNode(get(p,'infile')));
0049   elc.appendChild(elcc);
0050   
0051   % add plist
0052   pl = get(p,'plist');
0053   if isa(pl, 'plist')
0054     xml = xml_add_plist(xml, pl, elc);
0055   end
0056   
0057   % add a
0058   a = get(p,'a');
0059   for j=1:length(a)
0060     elcc = xml.docNode.createElement('A');
0061     elcc.appendChild(xml.docNode.createTextNode(num2str(a(j))));
0062     elc.appendChild(elcc);
0063   end
0064   
0065   % add b
0066   b = get(p,'b');
0067   for j=1:length(b)
0068     elcc = xml.docNode.createElement('B');
0069     elcc.appendChild(xml.docNode.createTextNode(num2str(b(j))));
0070     elc.appendChild(elcc);
0071   end
0072   
0073 end
0074 
0075 el.appendChild(elc);
0076 node.appendChild(el);
0077 
0078 
0079 
0080 % END

Generated on Fri 08-Jun-2007 16:09:11 by m2html © 2003