return_xml_type - return type of a xml file
txt = return_xml_type(fname)
- fname : string. source XML file (path+name)
- txt : string. the type of the scilab xml man page
//return_xml_type
//fonction qui retourne le texte placé entre
//les drapeaux <TYPE>
//et </TYPE> trouvés dans le fichier fname.xml
//ex : txt=return_xml_type(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_type(fname)
if fileinfo(fname)<>[] then
txt_temp=mgetl(fname);
txt=[]
j=1;
a=[];
if txt_temp<>[] then
for i=1:size(txt_temp,'*')
if strindex(txt_temp(i),'<TYPE>')<>[] then
a(j,1)=i;
end
if strindex(txt_temp(i),'</TYPE>')<>[] 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(i)+txt_temp(j)
end
end
end
else
printf("Warning : %s not found.\n",fname)
txt=[];
end
txt=strsubst(txt,'<TYPE>',"");
txt=strsubst(txt,'</TYPE>',"");
txt=stripblanks_begin(txt);
txt=stripblanks_end(txt);
txt=retrieve_char(txt)
endfunction
IRCOM Group
Alan Layec