Fonction Scilab
eng - fr


return_xml_sdesc - retourne la description courte d'un fichier xml

Librairie

Séquence d'appel

txt = return_xml_sdesc(fname)

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


//return_xml_sdesc
//fonction qui retourne le texte placé entre
//les deux premiers drapeaux <SHORT_DESCRIPTION>
//et </SHORT_DESCRIPTION> trouvés dans le fichier fname
//ex : txt=return_xml_sdesc(SCI+'/man/eng/nonlinear/intc.xml')
//Entrée fname : chemin+nom du fichier xml
//Sortie txt : tableau de chaines de caractères
function txt=return_xml_sdesc(fname)
if fileinfo(fname)<>[] then
 txt_temp=mgetl(fname);
 txt=[]
 j=1;
 a=[];
 if txt_temp<>[] then
  for i=1:size(txt_temp,'*')
   if strindex(txt_temp(i),'<SHORT_DESCRIPTION')<>[] then
    a(j,1)=i;
   end
   if strindex(txt_temp(i),'</SHORT_DESCRIPTION>')<>[] then
    a(j,2)=i;
    j=j+1;
   end
  end 

  for i=1:size(a,'r')
   for j=a(i,1):a(i,2)
    txt(i)=txt(i)+txt_temp(j)
   end
   txt(i)=part(txt(i),strindex(txt(i),''">')+2:length(txt(i)));
   txt(i)=strsubst(txt(i),('</SHORT_DESCRIPTION>'),'')
//    while part(txt(i),1)==' '
//     txt(i)=part(txt(i),2:length(txt(i)));
//    end
   txt(i)=stripblanks_begin(txt(i))
  end
 end
 
else
 printf("Warning : %s not found.\n",fname)
 txt=[];
end
txt=retrieve_char(txt)
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