<replacetokens>

Replaces tokens in the original input with user-supplied values.

This filter replaces all token surrounded by a beginning and ending token. The default beginning and ending tokens both default to '@'. The optional begintoken and endtoken attributes can be specified to change either token. By default string comparisons are case sensitive but this can be changed by setting the optional ignorecase attribute to true.

Tokens are specified by using the Token element. It is possible to specify from 1 to n tokens and replacement values. Values can be any valid NAnt expression.

Filters are intended to be used as a element of a <filterchain>.

Parameters

Attribute Type Description Required
begintoken char Marks the beginning of a token. The default is "@". False
endtoken char Marks the end of a token. The default is "@". False
ignorecase bool Determines if case will be ignored. The default is false. False
if bool If true then the filter will be used; otherwise, skipped. The default is true. False
unless bool Opposite of if. If false then the filter will be executed; otherwise, skipped. The default is false. False

Nested Elements:

<token>

Tokens and replacement values.

ReplaceTokens filter token.

Parameters

AttributeTypeDescriptionRequired
keystring Token to be replaced. True
valuestring New value of token. True
ifbool Indicates if the token should be used to replace values. If true then the token will be used; otherwise, not. The default is true. False
unlessbool Indicates if the token should not be used to replace values. If false then the token will be used; otherwise, not. The default is false. False

</token>

Examples

Requirements

Assembly: NAnt.Core (0.92.4543.0)