Changeset 560 for trunk/src/xml2struct.m
- Timestamp:
- Nov 21, 2012, 12:48:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/xml2struct.m
r477 r560 8 8 % INPUT: 9 9 % filename: name of the xml file 10 % varargin: optional list of strings to restrict the reading to a selection of subtrees, for instance 'GeometryCalib' (save time) 10 11 11 function [s,Heading]=xml2struct(filename )12 function [s,Heading]=xml2struct(filename,varargin) 12 13 t=xmltree(filename); 13 14 Heading=get(t,1,'name'); 14 ss=convert(t); 15 s=convert_string(ss); 15 if nargin>1 16 for isub=1:nargin-1 17 uid_sub=find(t,['/' Heading '/' varargin{isub}]); 18 tsub=branch(t,uid_sub); 19 ss=convert(tsub); 20 s.(varargin{isub})=convert_string(ss); 21 end 22 else 23 ss=convert(t); 24 s=convert_string(ss); 25 end 16 26 17 27
Note: See TracChangeset
for help on using the changeset viewer.