2
我有一個想在我的web.config更改URL值,但南特不斷拋出此錯誤南特腳本讀取分號時:問題與惡性腳本xmlpoke在一個字符串
'=' 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>
我能夠xmlpoke所有其他在web.config但是這一個「添加鍵」,所以它不是一個XPath問題。 這裏的惡性腳本:
<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腳本中跳過分號。任何人都知道如何做到這一點或其他什麼才能讓它起作用?