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

xml_read_time

PURPOSE ^

XML_READ_TIME read time object from the given node of an XML DOM

SYNOPSIS ^

function tt = xml_read_time(node)

DESCRIPTION ^

 XML_READ_TIME read time object from the given node of an XML DOM
 object.

 Diepholz 23-07-2007

 $Id: xml_read_time.html,v 1.3 2007/11/07 20:58:33 hewitson Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function tt = xml_read_time(node)
0002 
0003 % XML_READ_TIME read time object from the given node of an XML DOM
0004 % object.
0005 %
0006 % Diepholz 23-07-2007
0007 %
0008 % $Id: xml_read_time.html,v 1.3 2007/11/07 20:58:33 hewitson Exp $
0009 %
0010 
0011 disp('-- reading time');
0012 
0013 tt = time();
0014 children = node.getChildNodes;
0015 
0016 for j=1:children.getLength
0017   ch = children.item(j-1);
0018   nodeName = char(ch.getNodeName);
0019   switch nodeName
0020     case 'utc_epoch_milli'
0021       tt = set(tt, 'utc_epoch_milli', str2num(ch.getTextContent), 'direct');
0022     case 'timezone'
0023       timezone = char(ch.getTextContent);
0024       timezone = java.util.TimeZone.getTimeZone(timezone);
0025       tt = set(tt, 'timezone', timezone, 'direct');
0026     case 'timeformat'
0027       timeformat = xml_read_timeformat(ch);
0028       tt = set(tt, 'timeformat', timeformat, 'direct');
0029     case 'time_str'
0030       tt = set(tt, 'time_str', char(ch.getTextContent), 'direct');
0031     otherwise
0032 %       warning(['!!! unknown hist field: ' nodeName]);
0033   end
0034 end
0035 
0036 
0037

Generated on Tue 06-Nov-2007 12:08:42 by m2html © 2003