The ElementPath
attribute of XmlFile
element in wix accepts an xpath to select the target. How can I include namespace prefixes in this xpath?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
According to this issue entry it seems to be a bug or better: a not implemented feature, as an eventually existing default namespace is not exposed by the util:XmlFile
-element.
According to the first comment in this entry you can work around this issue by using util:XmlConfig
which should look in the empty namespace for the needed nodes / elements.
Edit: I've found another method for using it: according to this SO question by @LarsH you can use something like the following (didn't test it myself, but as it seem to be a valid XPath 1.0 expression, it should normally work):
"*[local-name() = 'foo' and namespace-uri() = 'http://my.org/ns/2.0']"
Remember to escape the square brackets, i.e. [...]
should become [\[]...[\]]
.