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.m,v 1.6 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_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.m,v 1.6 2007/07/30 12:13:10 ingo 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 xml = xml_add_time(xml, get(h, 'created'), 'created', el);
0027 
0028 % add n
0029 elc = xml.docNode.createElement('n');
0030 elc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(h, 'n'))));
0031 el.appendChild(elc);
0032 
0033 % add pn
0034 elc = xml.docNode.createElement('pn');
0035 elc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(h, 'pn'))));
0036 el.appendChild(elc);
0037 
0038 % add consver
0039 elc = xml.docNode.createElement('consver');
0040 elc.appendChild(xml.docNode.createTextNode(get(h, 'consver')));
0041 el.appendChild(elc);
0042 
0043 % add invars
0044 elc = xml.docNode.createElement('Invars');
0045 invars = get(h, 'invars');
0046 istr = '';
0047 for j=1:length(invars)
0048   istr = [istr ' ' invars{j}];
0049 end
0050 elc.appendChild(xml.docNode.createTextNode(istr));
0051 el.appendChild(elc);
0052 
0053 % add plist
0054 pl = get(h, 'plist');
0055 xml = xml_add_plist(xml, pl, el);
0056 
0057 % add inhists
0058 ih = get(h, 'inhists');
0059 if isa(ih, 'history')
0060   for j=1:length(ih)
0061     xml = xml_add_hist(xml, ih(j), el);
0062   end
0063 end
0064 
0065 %   h.inhists = [];
0066 %
0067 
0068 node.appendChild(el);
0069 
0070 
0071 
0072 % END

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