如何查找字符串xml文件并替换为其他字符串(值)

时间:2013-04-14 07:13:31

标签: c# xml windows-8

我的xml文件存在问题

<OneGoal>
<Goal>80000$ in year</Goal>
<Step>lack content</Step>
<Step>lack content</Step>
<Step>lack content</Step>
<Step>lack content</Step>
<Step>lack content</Step>
<Step>lack content</Step>
<Step>lack content</Step>
<Step>lack content</Step>
<Step>lack content</Step>
<Step>lack content</Step>
<DateDay>17</DateDay>
<DateMonth>6</DateMonth>
<DateYear>2015</DateYear>
</OneGoal>

我有来自文件的步骤的comboBox。我有checkBox,我点击SelectItemComboBox(任何人点击,SelectFile =“做运动”,我替换为“删除”)必须从列表和文件中删除步骤。我怎样做 ?

1 个答案:

答案 0 :(得分:0)

可能你正在寻找这样的东西:XPath: How to select elements based on their value?

Element[@attribute1="abc" and @attribute2="xyz" and text()="Data"]

所以,试试吧

/OneGoal/Step[text()="remove"]