return_xml_param - return parameters section of a xml file (obsolete)
txt = return_xml_param(fname)
- fname : string. source XML file (path+name)
- txt : string of vectors of size(n,2)
- txt(,1) : string. the title of the paremeter
- txt(,2) : string. the description of the paremeter
//return_xml_param
//fonction qui retourne le texte placé entre
//tous les drapeaux <ITEM label=,..> et </ITEM>
//trouvés dans le fichier fname
//ex : return_param(MODNUM+'/man/xml/CAN_f.xml')
//Entrée fname : chemin+nom du fichier xml
//Sortie txt : tableau de chaines de caractères
function txt=return_xml_param(fname)
txt_temp=mgetl(fname);
txt=[]
j=1;
a=[]
if txt_temp<>[] then
for i=1:size(txt_temp,'*')
if strindex(txt_temp(i),'<ITEM label=')<>[] then
a(j,1)=i;
end;
if strindex(txt_temp(i),'</ITEM>')<>[] then
a(j,2)=i;
j=j+1;
end
end
end
for i=1:size(a,'r')
txt(i,2)=''
for j=a(i,1):a(i,2)
if strindex(txt_temp(j),'<ITEM label=')<>[] then
txt(i,1)=strsubst(txt_temp(j),'<ITEM label=''','')
txt(i,1)=strsubst(txt(i,1),'''>','')
if part(txt(i,1),1)==[' '] then
txt(i,1)=part(txt(i,1),2:length(txt(i,1)))
end
end
if strindex(txt_temp(j),'<ITEM label=')==[] then
if strindex(txt_temp(j),'</ITEM>')==[] then
txt(i,2)=txt(i,2)+txt_temp(j);
end
end
end
end
for j=1:size(a,'r')
while part(txt(j,1),1)==' '
txt(j,1)=part(txt(j,1),2:length(txt(j,1)));
end
while part(txt(j,2),1)==' '
txt(j,2)=part(txt(j,2),2:length(txt(j,2)));
end
txt(j,2)=strsubst(txt(j,2),'<P>','\\');
txt(j,2)=strsubst(txt(j,2),'</P>','');
if part(txt(j,2),1)==':' then
txt(j,2)=part(txt(j,2),2:length(txt(j,2)));
end
while part(txt(j,2),1)==' '
txt(j,2)=part(txt(j,2),2:length(txt(j,2)));
end
end
endfunction
IRCOM Group
Alan Layec