0001 function aout = xdoc2ao(xdoc)
0002
0003
0004
0005
0006
0007
0008
0009
0010 ain = xdoc.getElementsByTagName('a');
0011 a = ain.item(0);
0012
0013 children = a.getChildNodes;
0014
0015 name = '';
0016 prov = [];
0017 description= '';
0018 mfile = '';
0019 mfname = '';
0020 mdlfile = '';
0021 mdlfname = '';
0022 hist = [];
0023 data = [];
0024
0025
0026 for j=1:children.getLength
0027
0028 ch = children.item(j-1);
0029
0030 nodeName = char(ch.getNodeName);
0031 if ischar(nodeName)
0032 switch nodeName
0033 case 'Name'
0034 name = char(ch.getTextContent);
0035 case 'Provenance'
0036 prov = xml_read_provenance(ch);
0037 case 'Description'
0038 description = char(ch.getTextContent);
0039 case 'M-file'
0040 mfile = char(ch.getTextContent);
0041 case 'Mfilename'
0042 mfname = char(ch.getTextContent);
0043 case 'Mdl-file'
0044 mdlfile = char(ch.getTextContent);
0045 case 'Mdlfilename'
0046 mdlfname = char(ch.getTextContent);
0047 case 'hist'
0048 hist = xml_read_hist(ch);
0049 case 'Data'
0050 data = xml_read_data(ch);
0051 otherwise
0052
0053 end
0054 end
0055 end
0056
0057
0058 aout.name = name;
0059 aout.data = data;
0060 aout.hist = hist;
0061 aout.provenance = prov;
0062 aout.description = description;
0063 aout.mfile = mfile;
0064 aout.mfilename = mfname;
0065 aout.mdlfile = mdlfile;
0066 aout.mdlfilename = mdlfname;
0067 aout = class(aout, 'ao');
0068
0069