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

xml_add_param

PURPOSE ^

XML_ADD_PARAM add a parameter object to the given node of the input XML

SYNOPSIS ^

function xml = xml_add_param(xml, p, node)

DESCRIPTION ^

 XML_ADD_PARAM add a parameter object to the given node of the input XML
 DOM object.
 
 M Hewitson 14-02-07
 
 $Id: xml_add_param.m,v 1.5 2007/07/30 12:13:10 ingo Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function xml = xml_add_param(xml, p, node)
0002 
0003 % XML_ADD_PARAM add a parameter object to the given node of the input XML
0004 % DOM object.
0005 %
0006 % M Hewitson 14-02-07
0007 %
0008 % $Id: xml_add_param.m,v 1.5 2007/07/30 12:13:10 ingo Exp $
0009 %
0010 
0011 el = xml.docNode.createElement('Param');
0012 
0013 if isa(p, 'param')
0014   % add version
0015   elc = xml.docNode.createElement('Version');
0016   elc.appendChild(xml.docNode.createTextNode(p.version));
0017   el.appendChild(elc);
0018 
0019   % add key
0020   elc = xml.docNode.createElement('Key');
0021   elc.appendChild(xml.docNode.createTextNode(p.key));
0022   el.appendChild(elc);
0023 
0024   % add value
0025   elc = xml.docNode.createElement('Value');
0026   if ischar(p.val)
0027     elc.appendChild(xml.docNode.createTextNode(p.val));
0028     el.appendChild(elc);
0029   elseif isnumeric(p.val)
0030     elc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(p.val)));
0031     el.appendChild(elc);
0032   elseif isa(p.val, 'specwin')
0033     xml = xml_add_specwin(xml, p.val, el);
0034   elseif isa(p.val, 'miir')
0035     xml = xml_add_miir(xml, p.val, el);
0036   elseif isa(p.val, 'pzmodel')
0037     xml = xml_add_pzmodel(xml, p.val, el);
0038   else
0039     p.val
0040     whos('p')
0041     error('### unknown parameter type.');
0042   end
0043     
0044 end
0045 
0046 node.appendChild(el);
0047 
0048 
0049 
0050 % END

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