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: fromxml.html,v 1.6 2008/02/12 12:17:51 hewitson Exp $

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: fromxml.html,v 1.6 2008/02/12 12:17:51 hewitson Exp $
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       created = char(x.getTextContent);
0017     case 'version'
0018       ver = char(x.getTextContent);
0019     case 'name'
0020       name = char(x.getTextContent);
0021     case 'psll'
0022       psll = str2num(char(x.getTextContent));
0023     case 'n'
0024       n = str2num(char(x.getTextContent)); 
0025     otherwise
0026   end
0027 end
0028 
0029 % build window
0030 switch name
0031   case 'Kaiser'
0032     w = specwin(name, n, psll);
0033   otherwise
0034     w = specwin(name, n);
0035 end
0036 
0037 w = set(w, 'created', created);
0038 w = set(w, 'version', ver);
0039 
0040 
0041 % END

Generated on Tue 12-Feb-2008 13:12:45 by m2html © 2003