简体   繁体   English

使用Linq的XML更新节点

[英]XML Update Nodes using Linq

I have a xml file with following entries, I want to update. 我有一个包含以下条目的xml文件,我想更新。 I have gone through other related questions but not solving my issue. 我经历了其他相关问题,但没有解决我的问题。

<Movie>
    <Name>21</Name>
    <Year>2008</Year>
    <Genre>Drama</Genre>
</Movie>

Go look at this question: 去看看这个问题:

Merging an XML file with a list of changes 合并具有更改列表的XML文件

I've linked to my answer because it contains a complete example - its probably slightly more complex than you need but still a trivially small number of line and combined with the debugger should give you all the elements (if you'll excuse the pun) you need to solve your problem 我已将其链接到我的答案,因为它包含一个完整的示例-可能比您需要的示例稍微复杂一些,但行数仍然很少,并且与调试器结合使用,应该可以为您提供所有元素(如果您原谅双关语)你需要解决你的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM