Extended Properties Reference
Here’s a detailed and structured explanation of the Extended Token Syntax properties in XDOC, including formatting, cleansing, and value mapping:
Extended Token Syntax – Instruction Properties
Extended tokens allow you to apply formatting, cleansing, and value mapping to token data using additional properties. These are placed after the token name, separated by vertical bars (|), and must follow a positional order.
Syntax Format:
$NAMESPACE.tokenName|dataType|dataFormat|dataMaxLen|mappedValues$
1. dataType
Specifies the type of data being formatted.\ Valid values:
stringdatenumber
This maps to .NET
IXDataFormatterinterface classes. Developers can plug in custom formatters if needed.
2. dataFormat
Defines the format mask to apply, based on the dataType.
For date and number:
Use any valid .NET format mask (e.g., yyyy-MM-dd, 0000.00).
For string:
You can use special formatting and cleansing masks:
Formatting Masks:
lowercase– Converts to lowercaseuppercase– Converts to uppercasetitlecase– Capitalizes the first letter of each wordpadleft:10:*– Pads left to 10 characters with*padright:10:*– Pads right to 10 characters with*
Cleansing Masks:
alpha– Removes all characters excepta–znumeric– Removes all characters except0–9alphanumeric– Removes all characters excepta–zand0–9regexcleanse:[^1-5a-3]– Removes characters matching the regex pattern
Multiple masks can be combined using commas:\
uppercase,alpha→ Converts to uppercase and removes non-alphabetic characters
3. dataMaxLen
Specifies the maximum length of the final output after formatting.\ If the result exceeds this length, it will be truncated.
Example:
$CONTAINER.name|string|uppercase,alpha|10$
- Converts the name to uppercase
- Removes non-alphabetic characters
- Truncates the result to 10 characters
4. mappedValues
Allows you to remap values using a delimiter-separated list of key-value pairs.
Syntax:
<delimiter><key1><value1><key2><value2>...
Example:
- If the token value is
1, the output will betif - If
2, thenpdf - If
3, thenother
Example Token with All Properties:
$CONTAINER.loanNumber|number|000000000|9,,1,LoanA,2,LoanB$
- Formats the loan number as a 9-digit number
- Truncates to 9 characters
- Maps
1toLoanA,2toLoanB