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

fromxml

PURPOSE ^

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

SYNOPSIS ^

function po = fromxml(xml)

DESCRIPTION ^

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

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