Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 读取字符串中的分号时nant脚本中的xmlpoke出现问题_Asp.net_Ant_Web Config_Nant_Xmlpoke - Fatal编程技术网

Asp.net 读取字符串中的分号时nant脚本中的xmlpoke出现问题

Asp.net 读取字符串中的分号时nant脚本中的xmlpoke出现问题,asp.net,ant,web-config,nant,xmlpoke,Asp.net,Ant,Web Config,Nant,Xmlpoke,我有一个nant脚本试图更改web.config中的URL值,但nant不断抛出以下错误: '=' is an unexpected token. The expected token is ';'. Line 1, position 80. 我追溯到nant脚本URL中的分号。我之所以在URL中使用分号,首先是因为web.config不喜欢符号(&)。所以我不得不用替换&。以下是我的web.config值: <appSettings> <add key="my

我有一个nant脚本试图更改web.config中的URL值,但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&amp;fullScreen=1"/>
</appSettings>

我可以xmlpoke web.config中的所有其他“添加键”,但这一个,所以这不是xpath问题。 这是南特的剧本:

<property name="myUrl" value="http://www.google.com/whatever?id=123456&amp;fullScreen=2"/>

<xmlpoke 
   file="${config.file}"
   xpath="/configuration/appSettings/add[@key = 'myUrl']/@value"
   value="${myUrl}">    
</xmlpoke>


因此,问题不在于web.config中的分号,而在于nant脚本中的分号。我想我需要设法避开nant脚本中的分号。有人知道如何做到这一点或其他什么让它工作吗?

已经16个小时了,没有人偷看。幸运的是,我在谷歌搜索了几个小时后找到了解决方案

解决方案是使用
&;amp。我不知道为什么额外的
amp但它起作用了。
现在我的nant脚本看起来是这样的:

<property name="myUrl" value="http://www.google.com/whatever?id=123456&amp;amp;fullScreen=2"/>

我刚刚签署的信用证是:)