bodewig 00/08/09 07:31:12
Modified: . WHATSNEW
docs index.html
Log:
Documentation for the multi line extension of <replace>
Revision Changes Path
1.13 +2 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- WHATSNEW 2000/08/09 13:12:11 1.12
+++ WHATSNEW 2000/08/09 14:31:05 1.13
@@ -48,6 +48,8 @@
* <chmod> works on all files in parallel and supports multiple filesets.
+* <replace> can now use tokens and/or values that cross line boundaries.
+
Fixed bugs:
-----------
1.70 +28 -1 jakarta-ant/docs/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/index.html,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- index.html 2000/08/09 13:12:11 1.69
+++ index.html 2000/08/09 14:31:09 1.70
@@ -2616,6 +2616,8 @@
<h3>Description</h3>
<p>Replace is a directory based task for replacing the occurrence of a given
string with another string
in selected file.</p>
+<p>If you want to replace a text that crosses line boundaries, you
+must use a nested <code><replacetoken></code> element.</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -2638,7 +2640,8 @@
<tr>
<td valign="top">token</td>
<td valign="top">the token which must be replaced.</td>
- <td valign="top" align="center">Yes</td>
+ <td valign="top" align="center">Yes, unless a nested
<code>replacetoken</code>
+ element is used.</td>
</tr>
<tr>
<td valign="top">value</td>
@@ -2681,6 +2684,30 @@
<pre> <replace file="${src}/index.html" token="@@@"
value="wombat" /></pre>
<p>replaces occurrences of the string "@@@" with the string
"wombat", in the file <code>${src}/index.html</code>.</p>
+<h3>Parameters specified as nested elements</h3>
+<p>If either the text you want to replace or the replacement text
+cross line boundaries, you can use nested elements to specify
+them.</p>
+<h3>Examples</h3>
+<blockquote><pre>
+<replace dir="${src}" value="wombat">
+ <include name="**/*.html" />
+ <replacetoken><[CDATA[multi line
+token]]></replacetoken>
+</replace>
+</pre></blockquote>
+<p>replaces occurrences of the string "multi
+line<em>\n</em>token" with the string "wombat", in all
+HTML files in the directory <code>${src}</code>.Where <em>\n</em> is
+the platform specific line separator.</p>
+<blockquote><pre>
+<replace file="${src}/index.html">
+ <replacetoken><[CDATA[two line
+token]]></replacetoken>
+ <replacevalue><[CDATA[two line
+token]]></replacevalue>
+</replace>
+</pre></blockquote>
<hr>
<h2><a name="rmic">Rmic</a></h2>
<h3>Description</h3>