txt = return_xml_desc2(fname)
Add here a paragraph of the function description. Other paragraph can be added
Add here a paragraph of the function description
Add here scilab instructions and comments
//return_xml_desc //fonction qui retourne le texte placé entre //les deux premiers drapeaux <DESCRIPTION> //et </DESCRIPTION> trouvés dans le fichier fname //compatilble avec help_skeleton //ex : txt=return_xml_desc2(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_desc2(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 txt_temp(i)=strsubst(txt_temp(i),'<DESCRIPTION_INDENT>',''); txt_temp(i)=strsubst(txt_temp(i),'</DESCRIPTION_INDENT>',''); txt_temp(i)=strsubst(txt_temp(i),'<DESCRIPTION>',''); txt_temp(i)=strsubst(txt_temp(i),'</DESCRIPTION>',''); txt_temp(i)=strsubst(txt_temp(i),'<DESCRIPTION_ITEM>',''); txt_temp(i)=strsubst(txt_temp(i),'</DESCRIPTION_ITEM>',''); txt_temp(i)=strsubst(txt_temp(i),'<P>',''); txt_temp(i)=strsubst(txt_temp(i),'<SP>',''); txt(j)=txt_temp(i); j=j+1; end end //Enlève les blancs du début txt=stripblanks_begin(txt); //Nettoie les lignes vides tt=[] k=1; for i=1:size(txt,1) if length(txt(i))<>0 then // tt(k)=strsubst(txt(i),"</P>",""); // tt(k)=strsubst(txt(i),"</SP>",""); tt(k)=txt(i); k=k+1; end end tt=strsubst(tt,"</P>",""); tt=strsubst(tt,"</SP>",""); //Nettoie la dernière ligne k=size(tt,1); tt(k)=stripblanks_begin(tt(k)); if length(tt(k))==0 then tt=tt(1:k-1), end; txt=retrieve_char(tt); endfunction