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.5 2007/11/07 20:58:33 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.5 2007/11/07 20:58:33 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   xml = xml_add_time(xml, get(p, 'created'), 'created', elc);
0028 
0029   % add fs
0030   elcc = xml.docNode.createElement('Fs');
0031   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'fs'))));
0032   elc.appendChild(elcc);
0033 
0034   % add ntaps
0035   elcc = xml.docNode.createElement('Ntaps');
0036   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'ntaps'))));
0037   elc.appendChild(elcc);
0038 
0039   % add gain
0040   elcc = xml.docNode.createElement('Gain');
0041   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(p,'g'))));
0042   elc.appendChild(elcc);
0043 
0044   % add infile
0045   elcc = xml.docNode.createElement('Infile');
0046   elcc.appendChild(xml.docNode.createTextNode(get(p,'infile')));
0047   elc.appendChild(elcc);
0048 
0049   % add plist
0050   pl = get(p,'plist');
0051   if isa(pl, 'plist')
0052     xml = xml_add_plist(xml, pl, elc);
0053   end
0054 
0055   % add a
0056   a = get(p,'a');
0057   for j=1:length(a)
0058     elcc = xml.docNode.createElement('A');
0059     elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(a(j))));
0060     elc.appendChild(elcc);
0061   end
0062 
0063   % add b
0064   b = get(p,'b');
0065   for j=1:length(b)
0066     elcc = xml.docNode.createElement('B');
0067     elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(b(j))));
0068     elc.appendChild(elcc);
0069   end
0070 
0071   % add histin
0072   ih = get(p, 'histin');
0073   if isa(ih, 'history')
0074     for j=1:length(ih)
0075       xml = xml_add_hist(xml, ih(j), el);
0076     end
0077   end
0078 
0079   % add histout
0080   oh = get(p, 'histout');
0081   if isa(oh, 'history')
0082     for j=1:length(oh)
0083       xml = xml_add_hist(xml, oh(j), el);
0084     end
0085   end
0086 
0087 end
0088 
0089 el.appendChild(elc);
0090 node.appendChild(el);
0091 
0092 
0093 
0094 % END

Generated on Tue 06-Nov-2007 12:08:42 by m2html © 2003