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

fromxml

PURPOSE ^

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

SYNOPSIS ^

function w = fromxml(xml)

DESCRIPTION ^

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function w = fromxml(xml)
0002 
0003 % FROMXML read from part of an XML tree and create a specwin object.
0004 %
0005 % M Hewitson 28-08-07
0006 %
0007 % $Id:$
0008 %
0009 
0010 
0011 sch = xml.getChildNodes;
0012 for c=1:sch.getLength
0013   x = sch.item(c-1);
0014   switch char(x.getNodeName)
0015     case 'created'
0016       xch = x.getChildNodes;
0017       created = time(xch.item(1));
0018     case 'version'
0019       ver = char(x.getTextContent);
0020     case 'name'
0021       name = char(x.getTextContent);
0022     case 'psll'
0023       psll = str2num(char(x.getTextContent));
0024     case 'n'
0025       n = str2num(char(x.getTextContent)); 
0026     otherwise
0027   end
0028 end
0029 
0030 % build window
0031 switch name
0032   case 'Kaiser'
0033     w = specwin(name, n, psll);
0034   otherwise
0035     w = specwin(name, n);
0036 end
0037 
0038 w = set(w, 'created', created);
0039 w = set(w, 'version', ver);
0040 
0041 
0042 % END

Generated on Fri 02-Nov-2007 19:39:27 by m2html © 2003