读取字符串中的分号时,在nant脚本中出现xmlpoke的问题
我有一个试图在我的web.config中更改URL值的nant脚本,但Nant不断抛出此错误:
'=' is an unexpected token. The expected token is ';'. Line 1, position 80.
我将其追溯到nant脚本的URL中的分号。我首先在URL中使用分号的原因是因为web.config不喜欢&符号(&)。所以我不得不更换&用&
。这是我的web.config值:
<appSettings>
<add key="myUrl" value="http://www.google.com/whatever?id=myId&fullScreen=1"/>
</appSettings>
我能够在web.config中xmlpo所有其他“添加键”但是这个,所以它不是一个xpath问题。
这是nant脚本:
<property name="myUrl" value="http://www.google.com/whatever?id=123456&fullScreen=2"/>
<xmlpoke
file="${config.file}"
xpath="/configuration/appSettings/add[@key = 'myUrl']/@value"
value="${myUrl}">
</xmlpoke>
所以问题不在于web.config中的分号,而是在nant脚本中使用分号。我想我需要以某种方式逃避nant脚本中的分号。任何人都知道如何做到这一点或其他什么来让它工作?
没有找到相关结果
已邀请:
1 个回复
目浆搽
。我不知道为什么额外的
但它有效。 所以现在我的nant脚本看起来像这样:
从nant-users邮件列表中获取信用额度,我刚刚订阅了:)