replacetokens

Description

replacetokens replaces tokens in the input with user-specified values.

Tokens must be prefixed and suffixed with a character. These are set with the prefix and suffix parameters. The default value for both of these is "@".

Parameters

Table 24. Parameters

Attribute Type Description Required
prefix string The start of the token to replace. The default value is "@". false
suffix string The end of the token to replace. The default value is "@". false

Nested Elements

token

The token to find and replace.

Table 25. Parameters

Attribute Type Description Required
key string The token value fo replace. true
value string The value that will replace the token. true

Examples

Example 15.  Copy a file and replace "%TODAY%" with the current date

<copy file="input.txt" tofile="processed.txt"> <filterchain> <replacetokens prefix="%" suffix="%"> <token key="TODAY" value="${ date::get-current-date() }" /> </replacetokens> </filterchain> </copy>