|
-
October 16th, 2009, 03:35 PM
#1
How can I open an XML File and replace an attribute value?
Lets say my value looks like this in the xml file
<<PARTNUMBER Value="352698563 " />
How can I replace that value number?
So far I have this
XmlDocument doc = new XmlDocument();
XmlNode node;
doc.Load(filename);
xpath = string.Format(@".//{0}[@{1}]", "PARTNUMBER" , "Value");
node = doc.DocumentElement.SelectSingleNode(xpath);
it successfully navigates to that node but how do I replace the value?
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
|