return_xml_used_func - return used function paragraph of a xml file
txt = return_xml_used_func(fname)
- fname : string. source XML file (path+name)
- txt : vector of strings. the text of the used function paragraph
//return_xml_used_func
//fonction qui retourne le texte placé entre
//les deux premiers drapeaux <USED_FUNCTIONS>
//et </USED_FUNCTIONS> trouvés dans le fichier fname
//compatilble avec help_skeleton
//ex : txt=return_xml_used_func(SCI+'/man/eng/nonlinear/intc.xml')
//Entrée fname : chemin+nom du fichier xml
function txt=return_xml_used_func(fname)
txt_temp=mgetl(fname)
txt=[]
a=[]
b=[]
if txt_temp<>[] then
for i=1:size(txt_temp,'*')
if strindex(txt_temp(i),'<USED_FUNCTIONS>')<>[] then a=i, end;
if strindex(txt_temp(i),'</USED_FUNCTIONS>')<>[] then b=i, end;
end
if a<>[] & b<>[] then
txt=txt_temp(a:b)
txt=strsubst(txt,'<USED_FUNCTIONS>',"")
txt=strsubst(txt,'</USED_FUNCTIONS>',"")
txt=strsubst(txt,'<SP>',"")
txt=strsubst(txt,'</SP>',"")
//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
IRCOM Group
Alan Layec