Changeset 685 for trunk/src/xml2struct.m


Ignore:
Timestamp:
Sep 19, 2013, 10:37:44 AM (10 years ago)
Author:
sommeria
Message:

error message improved for reading xml files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/xml2struct.m

    r675 r685  
    1010% varargin: optional list of strings to restrict the reading to a selection of subtrees, for instance 'GeometryCalib' (save time)
    1111
    12 function [s,Heading]=xml2struct(filename,varargin)
     12function [s,Heading,errormsg]=xml2struct(filename,varargin)
     13s=[];
     14Heading='';
     15errormsg='';
     16try
    1317t=xmltree(filename);
     18catch ME
     19    errormsg=ME.message;
     20    if regexp(ME.message,'xml_findstr')
     21        errormsg=[errormsg ': xmltree not correctly installed, download from www.artefact.tk/software/matlab/xml'];
     22    end
     23    return
     24end
    1425iline=0;
    15 Heading='';
     26
    1627while isempty(Heading)
    1728    iline=iline+1;
Note: See TracChangeset for help on using the changeset viewer.