Fonction Scilab
eng - fr


put_xml_sdesc - met à jour la description courte dans un fichier xml

Librairie

Séquence d'appel

new_tt = put_xml_sdesc(txt,filen)

Paramètres

Description

Add here a paragraph of the function description. Other paragraph can be added

Add here a paragraph of the function description

Exemple

Add here scilab instructions and comments

Contenu du fichier


//put_xml_sdesc
//Fonction qui insère une description courte
//dans un fichier xml contenant des délimiteurs
//<SHORT_DESCRIPTION et </SHORT_DESCRIPTION>
//Entrée : txt : chaînes de caractères de taille 1
//               contenant la description courte
//         filen : nom du fichier xml (ex:filen=xml_path+'CAN_f.xml')
function new_tt=put_xml_sdesc(txt,filen)
 if fileinfo(filen)<>[] then
  [p,q]=size(txt)
  if p==1 & q==1 then
    del1='<SHORT_DESCRIPTION'
    del2='</SHORT_DESCRIPTION>'
    tt_sav=mgetl(filen);
    a=0;b=0;new_tt=tt_sav;
    //trouve la position des délimiteurs
    for i=1:size(tt_sav,1)
     if strindex(tt_sav(i),del1)<>[] then a=i, end;
     if strindex(tt_sav(i),del2)<>[] then b=i, end;
    end
    if a<>0&b<>0 then
      name=basename(filen)
      tt_sdesc=['  <SHORT_DESCRIPTION name='"'+name+''">'+txt+'</SHORT_DESCRIPTION>']
      if a==b then
        new_tt=[tt_sav(1:a-1);tt_sdesc;tt_sav(b+1:size(tt_sav,1))]
      end
    end
  else
   printf("Incompatible rsh variable\n");
  end
 else
  printf("File %s not found\n",filen);
  new_tt=[];
 end
endfunction 

Fonction(s) utilisée(s)

Add here the used function name and references

Auteurs

enter here the author name Add here the author references