Fonction Scilab
eng - fr


return_xml_ex - retourne les exemples d'un fichier xml

Librairie

Séquence d'appel

txt = return_xml_ex(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_ex
//fonction qui retourne les exemples
//d'aide scilab construit avec help_skeleton
//ex : return_xml_ex((SCI+'/man/fr/nonlinear/ode.xml')
//Entrée fname : chemin+nom du fichier xml
//Sortie txt : tableau de chaines de caractères de taille n,2
//             colonne 1 : nom du paramètre
function txt=return_xml_ex(fname)
txt_temp=mgetl(fname);
txt=[]
j=1;
a=[]
b=[]
//Cherche les bornes <EXAMPLE> et </EXAMPLE>
if txt_temp<>[] then
  for i=1:size(txt_temp,'*')
    if strindex(txt_temp(i),'<EXAMPLE>')<>[] then
      a=i;
    end;
    if strindex(txt_temp(i),'</EXAMPLE>')<>[] then
      b=i;
    end
  end
 
  if a<>[] & b<>[] then
    txt=txt_temp(a:b)
    txt=strsubst(txt,'<EXAMPLE>',"")
    txt=strsubst(txt,'<P>',"")
    txt=strsubst(txt,'<![CDATA[',"")
    txt=strsubst(txt,']]>',"")
    txt=strsubst(txt,'</P>',"")
    txt=strsubst(txt,'</EXAMPLE>',"")
    //Enlève les blancs du début
    txt=stripblanks_begin(txt);
    //Nettoie les lignes vides
    tt=[]
    k=1;
    emptyf=%t; //Empty flag
    for i=1:size(txt,1)
      if length(txt(i))<>0 then
        tt(k)=txt(i);
        k=k+1;
        emptyf=%f;
      end
    end
    if emptyf then txt=""
    else txt=tt;
    end
  end
else
 txt=[]
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