Home > classes > @time > xmladd.m

xmladd

PURPOSE ^

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

SYNOPSIS ^

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

DESCRIPTION ^

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

 Diepholz 23-07-2007

 $Id: xml_add_time.m,v 1.3 2007/08/14 09:17:03 ingo Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function xml = xmladd(tts, xml, nodename, node)
0002 
0003 % XMLADD add a time object to the given node of the input XML DOM
0004 % object.
0005 %
0006 % Diepholz 23-07-2007
0007 %
0008 % $Id: xml_add_time.m,v 1.3 2007/08/14 09:17:03 ingo Exp $
0009 %
0010 
0011 el = xml.docNode.createElement(nodename);
0012 for j=1:length(tts)
0013   tt = tts(j);
0014   elc = xml.docNode.createElement('time');
0015 
0016   % add utc_epoch_milli
0017   elcc = xml.docNode.createElement('utc_epoch_milli');
0018   elcc.appendChild(xml.docNode.createTextNode(ltpda_mat2str(get(tt, 'utc_epoch_milli'))));
0019   elc.appendChild(elcc);
0020 
0021   % add timezone
0022   elcc = xml.docNode.createElement('timezone');
0023   timezone = get(tt, 'timezone');
0024   elcc.appendChild(xml.docNode.createTextNode(char(timezone.getID)));
0025   elc.appendChild(elcc);
0026 
0027   % add timeformat
0028   xml = xmladd(get(tt, 'timeformat'), xml, 'timeformat', elc);
0029 
0030   % add time_str
0031   elcc = xml.docNode.createElement('time_str');
0032   elcc.appendChild(xml.docNode.createTextNode(get(tt, 'time_str')));
0033   elc.appendChild(elcc);
0034 
0035   el.appendChild(elc);
0036 end
0037 node.appendChild(el);
0038 
0039 
0040 
0041 % END

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