Scilab Function
eng - fr


return_xml_desc - return long description of a xml file (obsolete)

Library

Calling Sequence

txt = return_xml_desc(fname)

Parameters

File content


//return_xml_desc
//fonction qui retourne le texte placé entre
//les deux premiers drapeaux <DESCRIPTION>
//et </DESCRIPTION> trouvés dans le fichier fname
//ex : txt=return_xml_desc(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_desc(fname)
 txt_temp=mgetl(fname)
 txt=[]
 if txt_temp<>[] then
  for i=1:size(txt_temp,'*')
   if strindex(txt_temp(i),'<DESCRIPTION>')<>[] then a=i, end;
   if strindex(txt_temp(i),'</DESCRIPTION>')<>[] then b=i, end;
  end
  j=1
  for i=a:b
   if strindex(txt_temp(i),'<DESCRIPTION>')<>[] then
     txt_temp(i)=strsubst(txt_temp(i),'<DESCRIPTION>','');
   end
   if strindex(txt_temp(i),'</DESCRIPTION>')<>[] then
     txt_temp(i)=strsubst(txt_temp(i),'</DESCRIPTION>','');
   end
   if strindex(txt_temp(i),'<P>')<>[] then
     txt_temp(i)=strsubst(txt_temp(i),'<P>','');
   end
   if strindex(txt_temp(i),'</P>')<>[] then
    txt_temp(i)=strsubst(txt_temp(i),'</P>','');
   end
   txt(j)=txt_temp(i);
   j=j+1;
  end
 end
endfunction

Authors

IRCOM Group Alan Layec