Changeset 450 for trunk/src/struct2xml.m
- Timestamp:
- Jun 12, 2012, 12:27:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/struct2xml.m
r42 r450 24 24 fieldnames=fields(Object); 25 25 for ilist=1:length(fieldnames) 26 eval(['val=Object.' fieldnames{ilist} ';'])26 val=Object.(fieldnames{ilist}); 27 27 if isstruct(val) 28 28 [t,uid]=add(t,root_uid,'element',fieldnames{ilist}); … … 60 60 end 61 61 end 62 elseif iscell(val) 63 siz=size(val); 64 if length(siz)<=2 %do not translate cell matrices with more than 2 indices 65 separator=' '; %mark the separation of columns 66 for iline=1:siz(1) 67 val_str=cell2mat(cell2tab(val(iline,:),' & ')); % produce a line string with column separator ' & ' 68 [t,new_uid]=add(t,uid,'element',key); 69 if siz(1)>1 70 t = attributes(t,'add',new_uid,'i',num2str(iline)); 71 end 72 [t]=add(t,new_uid,'chardata',val_str); 73 end 74 end 62 75 end
Note: See TracChangeset
for help on using the changeset viewer.