E.8 ReplaceTokens
Prev | Appendix E. Core filters | Next

## E.8 ReplaceTokens

The `ReplaceTokens` filter will replace certain tokens. Tokens are strings enclosed in special characters. If you want to replace `##BCHOME##` by the path to the directory set in the environment variable `BCHOME`, you could do the following:

    <property environment="env" />

    <filterchain>
      <replacetokens begintoken="##" endtoken="##">
        <token key="BCHOME" value="${env.BCHOME}" />
      </replacetokens>
    </filterchain>

Table E.6: Attributes for the `<replacetokens>` tag

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`begintoken` | `String` | The string that marks the beginning of a token. | @ | No
`endtoken` | `String` | The string that marks the end of a token. | @ | No

### E.8.1 Nested tags

The `ReplaceTokens` filter must contain one or more `token` tags. These must have a `key` and a `value` attribute.

Prev | Up | Next
E.7 PrefixLines | Home | E.9 ReplaceTokensWithFile