Scilab Function
eng - fr


return_xml_see_also - return see also section of a xml file

Library

Calling Sequence

txt = return_xml_see_also(fname)

Parameters

File content


//return_xml_see_also
//fonction qui retourne le texte placé entre
//tous les drapeaux <SEE_ALSO_ITEM>
//et </SEE_ALSO_ITEM> trouvés dans le fichier fname
//ex : txt=return_xml_see_also(MODNUM+'/man/xml/CNA_f.xml')
//Entrée fname : chemin+nom du fichier xml
//Sortie txt : tableau de chaines de caractères
function txt=return_xml_see_also(fname)
txt=[]
if fileinfo(fname)<>[] then
  txt_temp=mgetl(fname);
  a=[]
  j=1;
  if txt_temp<>[] then
    for i=1:size(txt_temp,'*')
      if strindex(txt_temp(i),'<SEE_ALSO_ITEM>')<>[] then
        a(j,1)=i;
      end
      if strindex(txt_temp(i),'</SEE_ALSO_ITEM>')<>[] 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_temp(j)
      end
      txt(i)=strsubst(txt(i),('<SEE_ALSO_ITEM>'),'')
      txt(i)=strsubst(txt(i),('</SEE_ALSO_ITEM>'),'')
      txt(i)=strsubst(txt(i),('<LINK>'),'')
      txt(i)=strsubst(txt(i),('</LINK>'),'')
      txt(i)=stripblanks(txt(i));
    end
  end
else
  printf("File %s not found\n",fname);
end
endfunction

Authors

IRCOM Group Alan Layec