put_xml_biblio - update bibliography references in xml file
new_tt = put_xml_biblio(txt,filen)
- txt : vector of strings. the vector of reference
- filen : string. target XML file (path+name)
- new_tt : vector of strings. the text of the new XML file
//put_xml_biblio
//Fonction qui insère les références bibliographiques
//dans un fichier xml contenant des délimiteurs
//<BIBLIO> et </BIBLIO>
//Entrée : txt : vecteur de chaînes de caractères de taille n,1
// contenant les ref. biblio.
// filen : nom du fichier xml (ex:filen=xml_path+'CAN_f.xml')
function new_tt=put_xml_biblio(txt,filen)
if fileinfo(filen)<>[] then
if size(txt,2)==1 then
del1='<BIBLIO>'
del2='</BIBLIO>'
tt_sav=mgetl(filen);
a=0;b=0;new_tt=tt_sav;
//trouve la position des délimiteurs
for i=1:size(tt_sav,1)
if strindex(tt_sav(i),del1)<>[] then a=i, end;
if strindex(tt_sav(i),del2)<>[] then b=i, end;
end
if a<>0&b<>0 then
tt_biblio=' '+['<BIBLIO>'
' <SP>';' '+txt(:,1);' </SP>'
'</BIBLIO>']
//Ecrit la chaine de texte finale
new_tt=[tt_sav(1:a-1);tt_biblio;tt_sav(b+1:size(tt_sav,1))]
end
else
printf("Incompatible rsh variable\n");
end
else
printf("File %s not found\n",filen);
new_tt=[];
end
endfunction
IRCOM Group
Alan Layec