|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi all,
This is my account.xml file: <?xml version = '1.0'?> <ACCOUNTS> <USER> <USERNAME>a</USERNAME> <PASSWORD>a</PASSWORD> </USER> <USER> <USERNAME>b</USERNAME> <PASSWORD>b</PASSWORD> </ACCOUNTS> i want to change the value of node USER if i enter username & password in textbox = username & password in one node for ex: enter old username= "b" enter old password= "b" enter new user name ="c" enter new password ="c" -> change the value of node USER which contain user b Result must be: <?xml version = "1.0"?> <MANAGE_ACCOUNTS> <USER > <USERNAME>a</USERNAME> <PASSWORD>a</PASSWORD> </USER> <USER > <USERNAME>c</USERNAME> <PASSWORD>c</PASSWORD> </USER > </MANAGE_ACCOUNTS> this is my script to do this: <script language = "javascript"> <XML ID="customers" SRC = "accounts.xml"></XML> function change_value() { var old_username = form.txtOldUsername.value; var old_password = form.txtOldpassword.value; var xmlDoc = new ActiveXObject("Microsoft.XMLDOM") xmlDoc.async="false" xmlDoc.load("accounts.xml") customers.recordset.moveFirst(); while (!customers.recordset.EOF) { var currentUserName = new String(customers.recordset("USERNAME")) var currentPassword = new String(customers.recordset("PASSWORD")) if(username == currentUserName && password == currentPassword ) { ....//what code i have to write here to change } customers.recordset.moveNext(); }//end of while (!customers.recordset.EOF) } </script> i don't know how to change the value of a node? please help me. Thanks.. |
|
#2
|
|||
|
|||
|
This is really more of a javascript question. You need someone that knows the MSXML javascript syntax.
I can move this thread to the javascript forum if you like. |
|
#3
|
|||
|
|||
|
Thank you very much, but i can solve this problem by myselft.
Thanks... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > how to change value of a node in xml document? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|