ReplaceData

Hello

I would like to replace data in an XML node from an HTML form.

Here is my XML file:
----------------------------------------------------------------------
<suivi>
	<part>
		<entree>
		......
		</entree>
		<entree>
			.......
		</entree>
		<entree>
			<jour>4. JES05.09.02</jour>
			<tk>32400</tk>
			<typdoc>
			</typdoc>
			<lgmod>
			</lgmod>
			<resplay>ere</resplay>
			<page>40</page>
			<langue>IT</langue>
			<render>
			</render>
			<is></is>
			<remarque></remarque>
		</entree>
	</part>
</suivi>
----------------------------------------------------------------------------
------

Here is my script :
----------------------------------------------------------------------------
-----
function modiflg(){
tkCible=document.form1.tk.value;
newlg=document.form1.lgmod.value;
confirmation=confirm("Voulez-vous réellement modifier la langue modèle de la
TK  "+tkCible+"?")
if (confirmation==true){
var xmlDoc = new ActiveXObject("MSXML.DOMDocument");
var oSelection;
xmlDoc.setProperty("SelectionLanguage", "XPath");
xmlDoc.async = false;
xmlDoc.load("suivi.xml");
oSelection = selectNodes("//entree[child::tk='"+tkCible+"']/lgmod");
oSelection.replaceData(0,2,newlg);
xmlDoc.save("suivi.xml");
alert ("Langue modèle pour "+tkCible+" modifiée");}
else{alert(tkCible+" n'a pas été modifiée")}
}
----------------------------------------------------------------------------
-------------------

Unfortunatunately, it doesn't work. Can someone, please, help me?
Thanks
Eric

Received on Tuesday, 17 September 2002 08:03:08 UTC