Home > classes > @plist > xmladd.m

xmladd

PURPOSE ^

XMLADD add a plist object to the given node of the input XML DOM

SYNOPSIS ^

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

DESCRIPTION ^

 XMLADD add a plist 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:17:56 hewitson Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function xml = xmladd(pls, xml, nodename, node)
0002 
0003 % XMLADD add a plist 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:17:56 hewitson Exp $
0009 %
0010 
0011 
0012 el = xml.docNode.createElement(nodename);
0013 
0014 for j=1:length(pls)
0015 
0016   pl = pls(j);
0017   % Now add object
0018   elc = xml.docNode.createElement('plist');
0019 
0020   %% Add AO name
0021   elcc = xml.docNode.createElement('name');
0022   elcc.appendChild(xml.docNode.createTextNode(pl.name));
0023   elc.appendChild(elcc);
0024 
0025   % add version
0026   elcc = xml.docNode.createElement('version');
0027   elcc.appendChild(xml.docNode.createTextNode(get(pl, 'version')));
0028   elc.appendChild(elcc);
0029 
0030   % add Created
0031   xml = xmladd(pl.created, xml, 'created', elc);
0032 
0033   ps = get(pl, 'params');
0034   if ~isempty(ps)
0035     xml = xmladd(ps, xml, 'params', elc);
0036   end
0037   el.appendChild(elc);
0038 end
0039 node.appendChild(el);
0040 
0041 
0042 
0043 
0044 
0045 
0046 
0047 
0048 % END

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