SWIFT Module 7.1 SP10.July 2020 | Package Services | XML Parsing Templates for SWIFT FIN Messages | Parsing Template Structure | Block Syntax of a Parsing Template
Block Syntax of a Parsing Template
The block elements in the SWIFT parsing template define the blocks in the SWIFT message. The syntax of a block directive is shown below. (Note that optional parameters are shown in square braces [ ].)
<block id="id" isMandatory="true|false" isList="true|false"
[termString="string"] [ EAImap="string"] [[extractHint="hint" idHint="hint"]
[ loadBlockHint="hint" blockPointer="pointer"]]
For the first (outer most) block directive, only the mandatory parameters are supplied. The first block directive identifies the entire message, which translates to the top level Enterprise document type. The syntax of the first block directive always takes the following syntax:
<block id="nnn" isMandatory="true" isList="false">
where nnn is the SWIFT message type number. This number must match the number in the parsing template file name, for example, for MT 101, the value of nnn must be 101 in the file swiftmt101.xml.
For all subsequent blocks, the block directive requires optional parameters. The full set of parameters are described below.
block id
The block number in the SWIFT message, including delimiting characters. For the first block directive this contains the message type ID.
true | false
false—The block is optional and is not required for the message to be valid.
true—The block is mandatory in an incoming message or the message will fail validation.
true | false
false—Only one instance of the block can occur.
true—The block can repeat one or more times.
\r (carriage return)
\n (line feed)
Characters that occur at the end of the block. Block 4 must be terminated with a carriage return, plus line feed. Blocks 1, 2, and 3 are not terminated with a carriage return plus line feed and the value of termString should be an empty string (termString=””).
document structure name
Represents the name of the structure in the document that the SWIFT message block is mapped to or from. By convention, the EAImap value for blocks is prefixed with “B.”
Parameter list
The first member must be BR, block is enclosed in braces. The syntactical clue used to identify the beginning and end of blocks.
*Incoming message—extractHint strips block markers from the raw data.
*Outgoing message—extractHint specifies the padding characters to apply to form a syntactically correct message block.
The “braces” used to enclose blocks can comprise any characters, such as {……blockdata…...-} or:16R:TRADE……blockdata.…..:16S:TRADE
For a full explanation of this element, see Hint Processing.
Parameter list
The first member must be FL. Tag is fixed length. Or EH tag is derived from the extractHint.
Syntactical clue used to extract the tag that identifies the block extracted using the extractHint.
*FL is usually used and strips the first few characters from the remaining raw data.
*EH extracts the first few characters from the block marker stripped by the extract hint. This is used where the block delimiters are themselves a string, such as, 16R:TRADE.
For SWIFT Module to identify the block correctly, the text returned by idHintmust match the value in the block ID element.
For a full explanation of this element, see Hint Processing.
Parameter list
The first member must be FL, tag is fixed length. Used for embedded messages, such as in n92, n95 and n96. These messages embed block 4 of a previously processed message. The embedded message can be any of the SWIFT message types.
loadBlockHint indicates the sub-template that must be embedded in the current parsing template whenever an embedded message is received. It extracts the message type number (100, 101, 521 etc.) from the data returned by a preceding lineAttribute.
For a full explanation of this element, see Hint Processing.
loadBlockHint must be used with blockPointer. If these elements are specified, extractHint and idHint are omitted.
Used along with loadBlockHint. Specifies that block 4 is to be included from the embedded parsing template.