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

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: fromxml.html,v 1.6 2008/02/12 12:18:05 hewitson Exp $
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     case 'created'
0028       xch = x.getChildNodes;
0029       p.created = time(xch.item(1));
0030     otherwise
0031   end
0032 end
0033 
0034 % build zero
0035 po = zero(p.f, p.q);
0036 po = set(po, 'name', p.name);
0037 po = set(po, 'version', p.version);
0038 po = set(po, 'created', p.created);
0039 
0040 % END

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