Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
删除WiX中的所有XML子项_Xml_Xpath_Wix - Fatal编程技术网

删除WiX中的所有XML子项

删除WiX中的所有XML子项,xml,xpath,wix,Xml,Xpath,Wix,Wix中是否有方法删除特定XML元素的所有子元素 我尝试了以下方法: <util:XmlConfig Id="Perf_delete" File="[INSTALLFOLDER]unity.config" ElementPath='/configuration/unity/container/register[\[]@name="Perf"[\]]/constructor/param[\[]@name="machineNames"[\]]/array' Verify

Wix中是否有方法删除特定XML元素的所有子元素

我尝试了以下方法:

<util:XmlConfig Id="Perf_delete"
    File="[INSTALLFOLDER]unity.config"
    ElementPath='/configuration/unity/container/register[\[]@name="Perf"[\]]/constructor/param[\[]@name="machineNames"[\]]/array'
    VerifyPath="*"
    Action="delete"
    Node="element"
    On="install"/>

我在这里具体说明:

  • ElementPath—指向元素本身
  • VerifyPath-*指定所有子元素
但是这只删除第一个子项


显然,有一种解决方法可以删除元素本身,然后重新创建它,但是对于所有属性和名称空间来说,这非常繁琐。

您可以删除父元素,然后再创建它,而无需添加新的嵌套子元素。只有一个util:XmlConfig声明,无法从父元素中删除多个子元素