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/imadoc2struct.m

    r675 r685  
    3535%% case of xml files
    3636if nargin ==1
    37     [s,Heading]=xml2struct(ImaDoc);% convert the whole xml file in a structure s
     37    [s,Heading,errormsg]=xml2struct(ImaDoc);% convert the whole xml file in a structure s
    3838elseif nargin ==2
    39     [s,Heading]=xml2struct(ImaDoc,varargin{1});% convert the xml file in a structure s, keeping only the subtree defined in input
     39    [s,Heading,errormsg]=xml2struct(ImaDoc,varargin{1});% convert the xml file in a structure s, keeping only the subtree defined in input
    4040else %TODO: deal with more than two subtrees?
    41     [s,Heading]=xml2struct(ImaDoc,varargin{1},varargin{2});% convert the xml file in a structure s, keeping only the subtree defined in input
     41    [s,Heading,errormsg]=xml2struct(ImaDoc,varargin{1},varargin{2});% convert the xml file in a structure s, keeping only the subtree defined in input
     42end
     43if ~isempty(errormsg)
     44    errormsg=['imadoc2struct/xml2struct/' errormsg];
     45    return
    4246end
    4347if ~strcmp(Heading,'ImaDoc')
    44     errormsg='the input xml file is not ImaDoc';
     48    errormsg='imadoc2struct/the input xml file is not ImaDoc';
    4549    return
    4650end
Note: See TracChangeset for help on using the changeset viewer.