开发者

Update XML file

开发者 https://www.devze.com 2022-12-30 17:47 出处:网络
I want to replace an XML node that is not a child of the root element. How can I do it - not in .NET 3.5?

I want to replace an XML node that is not a child of the root element. How can I do it - not in .NET 3.5?

I don't know the exact path to the no开发者_C百科de I want to replace, I get the node by XPath query like:

XmlElement root = doc.DocumentElement;
oldItem = root.SelectSingleNode("//Node1[@name='aaa']//Node2[Item='bbb']/Value");

How can I replace this old item?


Use root.SelectSingleNode("query").Value = [New value]

0

精彩评论

暂无评论...
验证码 换一张
取 消