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

fromxml

PURPOSE ^

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

SYNOPSIS ^

function po = fromxml(xml)

DESCRIPTION ^

 FROMXML read from part of an XML tree and create a provenance object.
 
 M Hewitson 28-08-07 
 
 $Id: fromxml.html,v 1.6 2008/02/12 12:18:06 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 provenance object.
0004 %
0005 % M Hewitson 28-08-07
0006 %
0007 % $Id: fromxml.html,v 1.6 2008/02/12 12:18:06 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 'creator'
0016       p.creator = char(x.getTextContent);
0017     case 'created'
0018       xch = x.getChildNodes;
0019       p.created = time(xch.item(1));
0020     case 'ip'
0021       p.ip = char(x.getTextContent);
0022     case 'hostname'
0023       p.hostname = char(x.getTextContent);
0024     case 'os'
0025       p.os = char(x.getTextContent);
0026     case 'matlab_version'
0027       p.matlab_version = char(x.getTextContent);
0028     case 'sigproc_version'
0029       p.sigproc_version = char(x.getTextContent);
0030     case 'ltpda_version'
0031       p.ltpda_version = char(x.getTextContent);
0032     otherwise
0033   end
0034 end
0035 
0036 % build provenance
0037 po = provenance(p);
0038 
0039 % END

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