473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Change Value of Existing Element

Lee

I have an xml Structure:

<?xml version="1.0" encoding="utf-16"?>
<Request>
<Operations>
<Command>
<OpType>login</OpType>
<Params>
<UserName>leebo</UserName>
<Password>leebo</Password>
</Params>
</Command>
</Operations>
</Request>

I'm trying to find out how to change the value of an element, say
<userName>john</UserName>

I'm using an XmlDocument, but I've been searching MSDN and google
groups for a couple of hours and I can't seem to find an answer.

Must I create and use an XMLWriter to perform this one small function?

Basically, I just need to change one element's value.

Sorry for such as basic question.

--
Warm Regards,

Lee
Nov 21 '05 #1
2 1267
Hi,

Yes. You must read in the document and write it back with the
changes.

Ken
------------------
"Lee" <lu*************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

I have an xml Structure:

<?xml version="1.0" encoding="utf-16"?>
<Request>
<Operations>
<Command>
<OpType>login</OpType>
<Params>
<UserName>leebo</UserName>
<Password>leebo</Password>
</Params>
</Command>
</Operations>
</Request>

I'm trying to find out how to change the value of an element, say
<userName>john</UserName>

I'm using an XmlDocument, but I've been searching MSDN and google
groups for a couple of hours and I can't seem to find an answer.

Must I create and use an XMLWriter to perform this one small function?

Basically, I just need to change one element's value.

Sorry for such as basic question.

--
Warm Regards,

Lee
Nov 21 '05 #2
Lee
Ken Tucker [MVP] enlightened me by writing:
Hi,

Yes. You must read in the document and write it back
with the changes.

Ken


Thanks Ken. Can you provide a link to sample? I'd really appreciate
it.

Thanks again,

--
Warm Regards,

Lee
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sarah West | last post by:
Hi, I have the following problem; This is my form, i would like to default the select box to USA, and default the text field to a name such as 'Sarah' and the hidden field to another number...
0
by: KemperR | last post by:
Dear Experts, I'm new to docbook and have sucessfully started to get into customisation layers. Therefore I changed the dtd as recomended. But I got stuck at the simple point when I want to add...
2
by: Nick Calladine | last post by:
Is this possible to ... I wish to get the value of a dropdown select but gets is indexable value (dont know if that is the right term) if that is possible (the position it assigned get assigned...
3
by: Frankie | last post by:
I'm writing a small utility app (C# Windows forms) used to create new ASP.NET Web sites. This utility needs to be able to change existing values in an existing Web.config. Please note: I do NOT...
6
by: libsfan01 | last post by:
hi all! is it possible to change an element type with javacript for example onclick to change a text box to a hidden element or to a textarea? kind regards marc
2
by: Eric Layman | last post by:
Hi, I have a radio button and a combo box. Upon changing a value for radio button, the combo box values will be dynamically updated. I have an idea on how to go abt doing it but Im stuck...
23
by: Jess | last post by:
Hello, I understand the default-initialization happens if we don't initialize an object explicitly. I think for an object of a class type, the value is determined by the constructor, and for...
5
by: yhlove | last post by:
Hi I'm trying to change element in xml file as described below: the xml file: ---------------- <MyProg> <Path>test1</Path> </MyProg>
5
by: moondaddy | last post by:
I have a custom control where users can set the backcolor of one of it's UI elements via a DP I created. One of the colors they can pick is a brush called CustomGradient where I would set the DP...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.