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

xml_add_hist

PURPOSE ^

XML_ADD_HIST add an history object to the given node of the input XML DOM

SYNOPSIS ^

function xml = xml_add_hist(xml, h, node)

DESCRIPTION ^

 XML_ADD_HIST add an history object to the given node of the input XML DOM
 object.
 
 M Hewitson 14-02-07
 
 $Id: xml_add_hist.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_hist(xml, h, node)
0002 
0003 % XML_ADD_HIST add an history object to the given node of the input XML DOM
0004 % object.
0005 %
0006 % M Hewitson 14-02-07
0007 %
0008 % $Id: xml_add_hist.html,v 1.1 2007/06/08 14:15:04 hewitson Exp $
0009 %
0010 
0011 el = xml.docNode.createElement('hist');
0012 
0013 %--- add myself first
0014 
0015 % add name
0016 elc = xml.docNode.createElement('Name');
0017 elc.appendChild(xml.docNode.createTextNode(get(h, 'name')));
0018 el.appendChild(elc);
0019 
0020 % add version
0021 elc = xml.docNode.createElement('Version');
0022 elc.appendChild(xml.docNode.createTextNode(get(h, 'version')));
0023 el.appendChild(elc);
0024 
0025 % add created
0026 elc = xml.docNode.createElement('Created');
0027 elc.appendChild(xml.docNode.createTextNode(get(h, 'created')));
0028 el.appendChild(elc);
0029 
0030 % add invars
0031 elc = xml.docNode.createElement('Invars');
0032 invars = get(h, 'invars');
0033 istr = '';
0034 for j=1:length(invars)
0035   istr = [istr ' ' invars{j}];
0036 end
0037 elc.appendChild(xml.docNode.createTextNode(istr));
0038 el.appendChild(elc);
0039 
0040 % add plist
0041 pl = get(h, 'plist');
0042 xml = xml_add_plist(xml, pl, el);
0043 
0044 ih = get(h, 'inhists');
0045 if isa(ih, 'history')
0046   for j=1:length(ih)
0047     xml = xml_add_hist(xml, ih(j), el);
0048   end
0049 end
0050 
0051 %   h.inhists = [];
0052 %
0053 
0054 node.appendChild(el);
0055 
0056 
0057 
0058 % END

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