在ant中,如何使用replace删除<;链接>;标签?
我试图消除index.html中的标记,但由于以下原因,我得到了这个错误:在ant中,如何使用replace删除<;链接>;标签?,ant,replace,Ant,Replace,我试图消除index.html中的标记,但由于以下原因,我得到了这个错误: <replace file="${build.dir}/${app.page.name}" token='<link rel="stylesheet" href="resources/AMC-all.css"/>' value=""/> The value of attribute "token" associated with an element type "null" must not c
<replace file="${build.dir}/${app.page.name}" token='<link rel="stylesheet" href="resources/AMC-all.css"/>' value=""/>
The value of attribute "token" associated with an element type "null" must not contain the '<' character.
与元素类型“null”关联的属性“token”的值不能包含“,这将解决它:
<fileset id="html.fileset"
dir="${build.dir}"
includes="${app.page.name}"/>
<replaceregexp replace="" flags="g"
match='\<\s*link\s*rel="stylesheet"\s*href=".*-all.css"\/\>'>
<fileset refid="html.fileset"/>
</replaceregexp>
其他不含正则表达式的解决方案:
<replace dir="${out.dir}" encoding="utf8">
<replacetoken><![CDATA[//<debug>]]></replacetoken>
<replacevalue><![CDATA[/*<debug>]]></replacevalue>
</replace>
]]>
]]>