如何在Ant脚本中的echo消息中打印A&B

Piy*_*ush 3 ant

<target name="three">
<echo message="A & B"/>
</target> 
Run Code Online (Sandbox Code Playgroud)

每当我运行此代码时,它会显示错误,The entity name must immediately follow the '&' in the entity reference. 如何我打印A&B请帮助我的人

Mat*_*son 7

&amp;而不是&


ska*_*man 7

Ant脚本必须是有效的XML,因此&符号需要XML转义:

<target name="three">
<echo message="A &amp; B"/>
</target> 
Run Code Online (Sandbox Code Playgroud)