Home > atmlab > arts > xml > xmlReadArray.m

xmlReadArray

PURPOSE ^

Reads an abitrary array from an XML file.

SYNOPSIS ^

function result = xmlReadArray(fid, attrlist, itype, ftype, binary, fid2)

DESCRIPTION ^

 Reads an abitrary array from an XML file.

    Internal function that should never be called directly.
    Use *xmlLoad* instead.

    The array can contain any kind of data. For ArrayOfArray the function
    calls itself recursively.

 FORMAT   result = xmlReadArray(fid, attrlist, itype, ftype, binary, fid2)

 OUT   result     Array
 IN    fid        File descriptor of XML file
 IN    attrlist   List of tag attributes
 IN    itype      Integer type of input file
 IN    ftype      Floating point type of input file
 IN    binary     Flag. 1 = binary file, 0 = ascii
 IN    fid2       File descriptor of binary file

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

xmlReadArray.m

SOURCE CODE ^

0001 % Reads an abitrary array from an XML file.
0002 %
0003 %    Internal function that should never be called directly.
0004 %    Use *xmlLoad* instead.
0005 %
0006 %    The array can contain any kind of data. For ArrayOfArray the function
0007 %    calls itself recursively.
0008 %
0009 % FORMAT   result = xmlReadArray(fid, attrlist, itype, ftype, binary, fid2)
0010 %
0011 % OUT   result     Array
0012 % IN    fid        File descriptor of XML file
0013 % IN    attrlist   List of tag attributes
0014 % IN    itype      Integer type of input file
0015 % IN    ftype      Floating point type of input file
0016 % IN    binary     Flag. 1 = binary file, 0 = ascii
0017 % IN    fid2       File descriptor of binary file
0018 
0019 % 2002-09-25   Created by Oliver Lemke.
0020 
0021 function result = xmlReadArray(fid, attrlist, itype, ftype, binary, fid2)
0022 
0023 ne = str2double (xmlGetAttrValue (attrlist, 'nelem'));
0024 atype = xmlGetAttrValue (attrlist, 'type');
0025 if length(atype) >= 5 && strcmp(atype(1:5), 'Array'), atype = 'Array'; end
0026 result = {};
0027 e = 0;
0028 while e ~= ne
0029   e = e + 1;
0030   result{e} = xmlReadTag(fid, '', itype, ftype, binary, fid2, atype);
0031 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005