0
我有一个XML文件,我想从我的NAnt脚本中搜索Error
单词。如果这个error
这个词确实存在,它将回显error exist
。如何在nant中从xml文件中搜索特定单词?
到目前为止我没有找到合适的方法。有人有什么主意吗?
我有一个XML文件,我想从我的NAnt脚本中搜索Error
单词。如果这个error
这个词确实存在,它将回显error exist
。如何在nant中从xml文件中搜索特定单词?
到目前为止我没有找到合适的方法。有人有什么主意吗?
可能在里面混淆${ ... }
。希望这可以帮助。
<?xml version="1.0"?>
<project name="Find a String" default="build" basedir=".">
<target name="build" description="various forms of string">
<echo message="hardcoded strings" />
<property name="stringFound" value="${string::contains('a string is a tiresome thing to search', 'tire')}" />
<echo message=" stringFound=${stringFound}" />
<echo message="property strings" />
<property name="stringToSearch" value="a property string is also a tiresome thing to search" />
<property name="findThis" value="tires" />
<property name="stringFound" value="${string::contains(stringToSearch, findThis)}"/>
<echo message=" stringFound=${stringFound}" />
</target>
</project>
这给
[echo] hardcoded strings
[echo] stringFound=True
[echo] property strings
[echo] stringFound=True
正是我需要的。谢谢 – Geddon