使用WIX xslt在XmlConfig中使用大括号设置值

时间:2016-06-21 12:30:18

标签: wix xslt-2.0

我正在尝试在包含大括号的WIX XmlConfig中设置一个值

我想设置一个像这样的值" IndexServer __%property {name} .zip"

<util:XmlFile 
    Id="AppConfigLocalFileDebugLogPath"
    Action="setValue"
    Permanent="yes" 
    ElementPath="//configuration/log4net/appender[\[]@name='LocalFileDebugLog'[\]]/file/@value"
    Value="[LOGFILEROOTPATH]\IndexServer\Debug\IndexServer_DEBUG__%property[\{]index-name[\}].log"
    File="[INSTALLFOLDER]Index.Webservice.exe.config"                   
    SelectionLanguage="XPath"
    Sequence="1"
/>

我认为它可以与[{]和[}]一起使用,因为[[]和[]]工作正常,但它没有。我从HEAT&#34; HEAT5055得到以下错误:将转换xxxxx应用于收获的Wix时出错:意外令牌&#39;]&#39;在表达&#34;

(或类似的东西,原始错误信息是德语;-))

如果我只是尝试:

<util:XmlFile 
     Id="AppConfigLocalFileDebugLogPath"
     Action="setValue"
     Permanent="yes" 
     ElementPath="//configuration/log4net/appender[\[]@name='LocalFileDebugLog'[\]]/file/@value"
     Value="[LOGFILEROOTPATH]\IndexServer\Debug\IndexServer_DEBUG__%property{index-name}.log"
     File="[INSTALLFOLDER]Index.Webservice.exe.config"                   
     SelectionLanguage="XPath"
     Sequence="1"
 />

这会产生一个字符串,如&#34; E:\ LogFiles \ WSIndexServer \ WSIndexServer __%property.log&#34;你可以看到字符串&#34; {index-name}&#34;迷路了; - (

你能在这帮我吗?我需要部分&#34; {index-name}&#34;包括字符串中的花括号。

非常感谢

克里斯

1 个答案:

答案 0 :(得分:1)

由于问题被标记为XSLT,并且正如您所说Value="[LOGFILEROOTPATH]\IndexServer\Debug\IndexServer_DEBUG__%property{index-name}.log" {index-name}丢失,我认为该值是在XSLT中评估的,您需要将{}加倍以避免被视为属性值模板,请尝试Value="[LOGFILEROOTPATH]\IndexServer\Debug\IndexServer_DEBUG__%property{{index-name}}.log"