Changeset 508 for trunk/src/editxml.m


Ignore:
Timestamp:
Jul 31, 2012, 6:55:39 PM (12 years ago)
Author:
sommeria
Message:

various improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/editxml.m

    r248 r508  
    5555% set(handles.replicate,'String',['copy';'<---'])
    5656if nargin
    57     CurrentFile=varargin{1}
     57    CurrentFile=varargin{1};
    5858else
    5959    CurrentFile=[];
     
    330330    head_name=get(t,1,'name');
    331331    %Path to shemas:
    332     path_uvmat=which('editxml');% check the path detected for source file uvmat
    333     path_UVMAT=fileparts(path_uvmat); %path to UVMAT
     332    path_uvmat=fileparts(which('editxml'));% check the path detected for source file uvmat
     333    % path_UVMAT=fileparts(path_uvmat); %path to UVMAT
    334334    %     xmlparam=fullfile(path_UVMAT,'PARAM.xml');
    335     xmlparam='PARAM.xml'; %will find PARAM.xml whose path is set in priority
    336     if exist(xmlparam,'file')
    337         tparam=xmltree(xmlparam);
    338         sparam=convert(tparam);
    339         if isfield(sparam,'SchemaPath')
    340             schemafile=[fullfile(sparam.SchemaPath,head_name) '.xsd'];           
    341             if ~exist(schemafile,'file')
    342                 schemafile=fullfile(path_UVMAT,schemafile);%look for relative path definition
    343             end
    344             if exist(schemafile,'file')
    345                 xs=xmltree(schemafile);
    346             else
    347                 msgbox_uvmat('ERROR',['The needed xml schema  ' sparam.SchemaPath ' is not found, check the file PARAM.xml'])
    348                 [FileName, PathName]=uigetfile( ...
    349                     {'*.xsd', '(*.xsd)';
    350                     '*.xsd',  '.xsd files '; ...
    351                     '*.*',  'All Files (*.*)'}, ...
    352                     'Pick a .xsd schema' ,schemafile); %file browser
    353                 if ischar(PathName) && ischar(FileName) && exist(fullfile(PathName,FileName),'file')
    354                     DataIn.Schema=fullfile(PathName,FileName);
    355                     xs=xmltree(DataIn.Schema);%open the associated schema file
    356                 else
    357                     xs=[];
    358                 end
    359             end
    360         end
    361     end
     335    %     xmlparam='PARAM.xml'; %will find PARAM.xml whose path is set in priority
     336    %     if exist(xmlparam,'file')
     337    %         tparam=xmltree(xmlparam);
     338    %         sparam=convert(tparam);
     339    %         if isfield(sparam,'SchemaPath')
     340    schemafile=[fullfile(path_uvmat,'xml_shemas',head_name) '.xsd'];
     341    if ~exist(schemafile,'file')
     342        schemafile=fullfile(path_UVMAT,schemafile);%look for relative path definition
     343    end
     344    if exist(schemafile,'file')
     345        xs=xmltree(schemafile);
     346    else
     347        msgbox_uvmat('ERROR',['The needed xml schema  ' sparam.SchemaPath ' is not found, check the file PARAM.xml'])
     348        [FileName, PathName]=uigetfile( ...
     349            {'*.xsd', '(*.xsd)';
     350            '*.xsd',  '.xsd files '; ...
     351            '*.*',  'All Files (*.*)'}, ...
     352            'Pick a .xsd schema' ,schemafile); %file browser
     353        if ischar(PathName) && ischar(FileName) && exist(fullfile(PathName,FileName),'file')
     354            DataIn.Schema=fullfile(PathName,FileName);
     355            xs=xmltree(DataIn.Schema);%open the associated schema file
     356        else
     357            xs=[];
     358        end
     359    end
     360    %         end
     361    %     end
    362362end
    363363DataIn.CurrentUid=1;
Note: See TracChangeset for help on using the changeset viewer.