Home > classes > @time > private > fromxml.m

fromxml

PURPOSE ^

FROMXML read from part of an XML tree and create a time object.

SYNOPSIS ^

function t = fromxml(xml)

DESCRIPTION ^

 FROMXML read from part of an XML tree and create a time object.
 
 M Hewitson 28-08-07 
 
 $Id:$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function t = fromxml(xml)
0002 
0003 % FROMXML read from part of an XML tree and create a time object.
0004 %
0005 % M Hewitson 28-08-07
0006 %
0007 % $Id:$
0008 %
0009 
0010 % disp('---------------- time ------------------')
0011 % xml.getNodeName
0012 % disp('---------------- time ------------------')
0013 
0014 sch = xml.getChildNodes;
0015 for c=1:sch.getLength
0016   x = sch.item(c-1);
0017   switch char(x.getNodeName)
0018     case 'utc_epoch_milli'
0019       utc_epoch_milli = str2num(char(x.getTextContent));
0020     case 'timezone'
0021       timezone = char(x.getTextContent);
0022     case 'timeformat'
0023       xch = x.getChildNodes;
0024       tf = timeformat(xch.item(1));
0025     case 'time_str'
0026       time_str = char(x.getTextContent);
0027     otherwise
0028   end
0029 end
0030 
0031 % build time
0032 t = time(utc_epoch_milli);
0033 t = set(t, 'timezone', timezone);
0034 % t = set(t, 'timeformat', tf);
0035 
0036 % END

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