XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 21st, 2003, 05:50 AM
baolong baolong is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 17 baolong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Arrow how to change value of a node in xml document?

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..

Reply With Quote
  #2  
Old September 22nd, 2003, 06:37 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
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.

Reply With Quote
  #3  
Old September 22nd, 2003, 09:07 PM
baolong baolong is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 17 baolong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you very much, but i can solve this problem by myselft.
Thanks...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > how to change value of a node in xml document?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT