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?
Printable View
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?
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.
Fyi, XmlDocument is pretty slow. XmlReader would be faster. Serialization may even be an option.
You can also use XPathNavigator.SetValue.
How are you going to modify then save a xml file with a xmlReader? Is that not what needs to be done...Quote:
Originally Posted by kasracer
I guess it's open to interpretation... perhaps vbbit can let us know.
XmlWriter :)Quote:
Originally Posted by brin351
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 somethingQuote:
Originally Posted by kasracer