Tags

Here is another common one. If you have to write a from Ant

<?xml version=”1.0″ encoding=”UTF-8″?>
<project name=”attrtest” basedir=”.” default=”writeFile”>

<target name=”writeFile”>

<!– plain write to file –>
<echo file=”sitest.txt”>
Hello Test! This content is in a file\n
blah
blah more blah
</echo>

<!– plain write with append –>
<echo file=”siappend.txt” append=”true”>
this is a write test with append.
you have to run it multiple times to see it in action.
</echo>

<!– if you write HTML like files or write special characters use CDATA –>
<echo file=”sitest.html”><![CDATA[
<html>
<body>
This is an html file
</body>
</html>]]>
</echo>

</target>

</project>

Advertisements