如何从web.config文件中删除元素?

时间:2012-04-11 12:16:30

标签: xml wix

我想从web.config中删除一些元素(它安装在此安装中),如果某些PROP =“0”

<configuration>
 <thingy>
  <stuff>
   <item type='value1'  name='name1' file='node1.txt'/>
   <item type='value2' name='name2' file='node2.txt'/>
  </stuff>
 </thingy>
</configuration>

我正在尝试这样做

<util:XmlConfig
  On="install"
  Action="delete"
  Id="RemoveAnElement"
  Node="element"
  File="Application.dll.config"
  VerifyPath="/configuration/thingy/stuff/item[\[]@type='value1'[\]]"
  ElementPath="/configuration/thingy/stuff"
  Sequence="100"
/>

没有错误,但元素仍然存在。如何删除它?

1 个答案:

答案 0 :(得分:3)

从基础XML文件中删除元素并反转逻辑,以便在PROP =“1”时WiX添加元素。

相关问题