2016-06-21 32 views
0

我想設置在維克斯的XMLConfig包含大括號設置在XMLConfig的大括號與維克斯XSLT值

我想設置一個值,像這樣「的IndexServer __%屬性{名} .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以下錯誤「HEAT5055:錯誤施加變換爲XXXXX到收穫維克斯:在表達意外的標記‘]’」

(或類似的東西,原始的錯誤消息是在德國;-))

如果我只是嘗試:

<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" 
/> 

這導致像一個字符串 「E:\ LogFiles文件\ WSIndexServer \ WSIndexServer __%property.log」 你可以看到字符串 「{索引名}」 丟失;-(

你能幫我嗎?我需要零件「{index-name}」包括g字符串中的大括號。

非常感謝

克里斯

回答

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"

+0

嘿馬丁非常感謝這個作品 - 它非常簡單;-) – chris079

+1

@ chris079,參見http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work關於如何表明你的問題解決了。 –