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

fromxml

PURPOSE ^

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

SYNOPSIS ^

function t = fromxml(xml)

DESCRIPTION ^

 FROMXML read from part of an XML tree and create a timespan 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 timespan object.
0004 %
0005 % M Hewitson 28-08-07
0006 %
0007 % $Id:$
0008 %
0009 
0010 % disp('---------------- timespan ------------------')
0011 % xml.getNodeName
0012 % disp('---------------- timespan ------------------')
0013 
0014 sch = xml.getChildNodes;
0015 for c=1:sch.getLength
0016   x = sch.item(c-1);
0017   switch char(x.getNodeName)
0018     case 'start'
0019       xch = x.getChildNodes;
0020       start = time(xch.item(1));
0021     case 'end'
0022       xch = x.getChildNodes;
0023       stop = time(xch.item(1));
0024     case 'timeformat'
0025       xch = x.getChildNodes;
0026       tf = timeformat(xch.item(1));
0027     otherwise
0028   end
0029 end
0030 
0031 % build time
0032 t = timespan(start, stop, tf);
0033 % t = timespan(start, stop);
0034 
0035 % END

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