|
-
Dec 8th, 2008, 07:04 PM
#1
Thread Starter
Frenzied Member
change xml's value
Hi, I Have an xml in a format like this:
<Client>Test</Client>
<Client>Test2 </Client>
Now, when the user submits say he/she selects Test2, behind the code, I want to change that "Test 2" value to "User select Test 2", can I accomplish that?
-
Dec 8th, 2008, 07:57 PM
#2
Re: change xml's value
Load a xmlDocument object with your xml file. Then selectSingleNode - the node you want to change, set the nodes innerText property to "your text" then save the xmlDocument.
If you get stuck let us know.
-
Dec 8th, 2008, 08:45 PM
#3
Re: change xml's value
Fyi, XmlDocument is pretty slow. XmlReader would be faster. Serialization may even be an option.
-
Dec 9th, 2008, 03:08 AM
#4
-
Dec 9th, 2008, 05:39 PM
#5
Re: change xml's value
 Originally Posted by kasracer
Fyi, XmlDocument is pretty slow. XmlReader would be faster. Serialization may even be an option.
How are you going to modify then save a xml file with a xmlReader? Is that not what needs to be done...
I guess it's open to interpretation... perhaps vbbit can let us know.
-
Dec 9th, 2008, 06:12 PM
#6
Re: change xml's value
 Originally Posted by brin351
How are you going to modify then save a xml file with a xmlReader? Is that not what needs to be done...
I guess it's open to interpretation... perhaps vbbit can let us know.
XmlWriter
-
Dec 9th, 2008, 07:50 PM
#7
Re: change xml's value
 Originally Posted by kasracer
XmlWriter 
OK but you will have to re-create the entire xml documented with the change, instead of just makeing the change.. or am I missing something
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|