Pete,
Attached is the patch you requested to docs/index.html. Let me know if you
need anything else.
Thanks,
--Thayer
On Mon, 15 Jan 2001, Peter Donald wrote:
> At 02:12 11/1/01 -0800, Thayer Robins wrote:
> >I don't belive this has been picked up yet.
>
> kewl ;)
>
> >This patch adds an additional, nested element ('replacefilter') to the
> >replace task. In addition to allowing for multiple replacements, the nested
> >element allows replacement values to be extracted from a property file. The
> >name of this file is specified using an optional 'replace' attribute
> >(propertyFile).
> >
> >replacefilter has the following attributes:
> >
> > token (mandatory) -> string to search for
> > value (optional) -> replacement string
> > property (optional) -> name of property whose value is to serve as the
> >replacement value
> >
> >Either value or property may be specified, but not both. If neither is
> >provided, the value provided using the replace attribute 'value' and/or the
> >'replacevalue' element is used. If no value was specified there either, the
> >token is replaced with an empty string.
> >
> >The existing elements and attributes of replace are still supported, so it
> >is possible to use either the token/replacetoken and value/replacevalue
> >attributes/elements, the nested replacefilter elements, or both in the same
> >operation.
>
> Would you be able to rework the above into a patch for docs/index.html ? ;)
>
> Cheers,
>
> Pete
>
> *-----------------------------------------------------*
> | "Faced with the choice between changing one's mind, |
> | and proving that there is no need to do so - almost |
> | everyone gets busy on the proof." |
> | - John Kenneth Galbraith |
> *-----------------------------------------------------*
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--- index.html Tue Jan 16 05:19:34 2001
+++ new-index.html Tue Jan 16 05:19:38 2001
@@ -4262,6 +4262,11 @@
<td valign="top" align="center">No</td>
</tr>
<tr>
+ <td valign="top">propertyFile</td>
+ <td valign="top">valid property file from which properties specified using
nested <code><replacefilter></code> elements are drawn.</td>
+ <td valign="top" align="center">Yes only if <i>property</i> attribute of
<code><replacefilter></code> is used.</td>
+ </tr>
+ <tr>
<td valign="top">includes</td>
<td valign="top">comma separated list of patterns of files that must be
included. All files are included when omitted.</td>
@@ -4305,7 +4310,7 @@
cross line boundaries, you can use nested elements to specify
them.</p>
<h3>Examples</h3>
-<blockquote><pre>
+<blockquote><pre>
<replace dir="${src}" value="wombat">
<include name="**/*.html"/>
<replacetoken><![CDATA[multi line
@@ -4316,7 +4321,7 @@
line<i>\n</i>token" with the string "wombat", in all
HTML files in the directory <code>${src}</code>.Where <i>\n</i> is
the platform specific line separator.</p>
-<blockquote><pre>
+<blockquote><pre>
<replace file="${src}/index.html">
<replacetoken><![CDATA[two line
token]]></replacetoken>
@@ -4324,6 +4329,51 @@
token]]></replacevalue>
</replace>
</pre></blockquote>
+<h4>replacefilter</h4>
+<p>In addition to allowing for multiple replacements, optional nested
<code><replacefilter></code> elements allow replacement values to be
extracted from a property file. The name of this file is specified using the
<code><replace></code> attribute <i>propertyFile</i>.
+</p>
+<table border="1" cellpadding="2" cellspacing="0">
+ <tr>
+ <td valign="top"><b>Attribute</b></td>
+ <td valign="top"><b>Description</b></td>
+ <td align="center" valign="top"><b>Required</b></td>
+ </tr>
+ <tr>
+ <td valign="top">token</td>
+ <td valign="top">The string to search for.</td>
+ <td align="center" valign="top">Yes</td>
+ </tr>
+ <tr>
+ <td valign="top">value</td>
+ <td valign="top">The replacement string.</td>
+ <td align="center" rowspan="2">Either may be specified, but not both. Both
can be omitted, if desired.</td>
+ </tr>
+ <tr>
+ <td valign="top">property</td>
+ <td valign="top">Name of the property whose value is to serve as the
replacement value.</td>
+ </tr>
+</table>
+<p>If neither <i>value</i> nor <i>property</i> is used, the value provided
using the <code><replace></code> attribute <i>value</i> and/or the
<code><replacevalue></code> element is used. If no value was specified
using either of these options, the token is replaced with an empty string.
+</p>
+<h3>Examples</h3>
+<blockquote><pre>
+<replace
+ file="configure.sh"
+ value="defaultvalue"
+ propertyFile="source/name.properties" >
+ <replacefilter
+ token="@token1@" />
+ <replacefilter
+ token="@token2@"
+ value="value2"/>
+ <replacefilter
+ token="@token3@"
+ property="property.key"/>
+</replace>
+</pre></blockquote>
+<p>In file <code>configure.sh</code>, replace all instances of
"@token1@" with "defaultvalue", all instances of
"@token2@" with "value2", and all instances of
"@token3@" with the value of the property "property.key",
as it appears in property file <code>src/name.properties</code>.</p>
+<p><b>Note:</b> It is possible to use either the
<i>token</i>/<code><replacetoken></code> and
<i>value</i>/<code><replacevalue></code> attributes/elements, the nested
replacefilter elements, or both in the same operation.
+</p>
<hr>
<h2><a name="rmic">Rmic</a></h2>
<h3>Description</h3>