Skip to content

MT-XML Conversion

Back and forth conversion between MT messages and proprietary XML

For MT to MX (ISO 20022) standard translations please check the Prowide Integrator MT-MX Translations module.

To facilitate integration with other platforms and systems, MT format can be converted to XML. This XML format is proprietary and not part of the SWIFT standard, and basically consists of a linear translation of the hierarchical structure of blocks and fields of an MT swift message to XML.

The main entry point for this feature is the AbstractMT class (actually any of its subclasses, for example MT103) where a simple call to the xml() method will return the message content in XML.

The following example illustrates the XML format for the message headers:

<message>
    <block1>
        <applicationId>F</applicationId>
        <serviceId>01</serviceId>
        <logicalTerminal>BICFOOYYAXXX</logicalTerminal>
        <sessionNumber>8683</sessionNumber>
        <sequenceNumber>497519</sequenceNumber>
    </block1>
    <block2 type="output">
        <messageType>103</messageType>
        <senderInputTime>1535</senderInputTime>
        <MIRDate>051028</MIRDate>
        <MIRLogicalTerminal>ESPBESMMAXXX</MIRLogicalTerminal>
        <MIRSessionNumber>5423</MIRSessionNumber>
        <MIRSequenceNumber>752247</MIRSequenceNumber>
        <receiverOutputDate>051028</receiverOutputDate>
        <receiverOutputTime>1535</receiverOutputTime>
        <messagePriority>N</messagePriority>
    </block2>
    ...
</message>

A similar serialization is performed for user and trailer blocks.

For the message text block (block 4) two different XML formats are supported, each related to a model layer. The simpler one serializes fields as simple name-value tuples, and the enriched one serializes each field component in individual XML tags.

For example a Field13C instance in the enriched version will be splitted as:

<field>
    <name>13C</name>
    <component number="1">RNCTIME</component>
    <component number="2">1534</component>
    <component number="3">+</component>
    <component number="4">0000</component>
</field>

While in the compressed format this will be just:

<tag>
    <name>13C</name>
    <value>RNCTIME1534+0000</value>
</tag>

The xml() method mentioned will return the enriched version.

Additional XML related features are contained in the ConversionService class. The analogous translation from this XML into a SWIFT message is provided there, as well the serialization into the comprised XML format.

The parser implementation can seamlessly read both plain and enriched formats.