9 Common XSD Errors in EMIR Refit

EMIR Refit introduced a major structural change with the move from CSV to XML file structure.
XML uses an imbedded schema and validation system using XSD files. Essentially, when creating an EMIR Refit XML file, it is checked against a set of formatting and data rules in the XSD file . If your XML file doesn’t meet those rules, an error will appear.

Here is a list of the most common errors and their causes:

1. Element ‘<XYZ>’ is not allowed at this location

This error occurs when an element is placed in a location where it is not permitted by the XSD schema. This typically happens due to incorrect element ordering or nesting.

Example: Consider the derivatives report where all action types (NEWT, MODI, VALU, TERM, POSC, EROR, CORR, REVI) must include three specific elements in a precise order according to the XSD schema-

<CtrPtySpcfcData>This is the first element and contains counterparties’ specific data. It is a complex type, meaning it has nested elements within it.
<CmonTradData>This is the second element and includes common trade data such as contract data and transaction data. It is also a complex type with nested elements.
<Lvl>This is the third element and indicates the level of the trade. It is a simple type, containing only a single value, either PSTN (Position level) or TCTN (Transaction level).

If these elements are not in the correct order, such as if <Lvl> appears before <CtrPtySpcfcData> or <CmonTradData>, this error will occur. Additionally, if there is an unexpected element, say <XYZ>, inside the action type’s nested structure, the error will be triggered.

Incorrect order XML example<ActionType>
        <Lvl>PSTN</Lvl> <!– Incorrect order: <Lvl> should be the last element –>
        <CtrPtySpcfcData>…</CtrPtySpcfcData>
        <CmonTradData>…</CmonTradData>
</ActionType>
Unexpected element XML example<ActionType>
        <CtrPtySpcfcData>…</CtrPtySpcfcData>
        <CmonTradData>…</CmonTradData>
        <XYZ>…<XYZ> <!—Unexpected element: <XYZ> is not a part of the sequence for         <Lvl>PSTN</Lvl>
</ActionType>
Correct XML example<ActionType>
        <CtrPtySpcfcData>…</CtrPtySpcfcData>
        <CmonTradData>…</CmonTradData>
        <Lvl>PSTN</Lvl> <!– Correct order –>
</ActionType>

TRAction’s XML generator is coded strictly based on the schema to ensure elements are always produced in the correct order and no unexpected elements can occur in the output XML.

2. Element ‘<XYZ>’ has an invalid child element ‘<ABC>’

This error occurs when an element does not contain all the required child elements as specified by the XSD schema. This typically happens due to missing data from TRAction’s client’s input files (from their trading platform or back office system).


Example: Consider a derivative report where the <TxData> (Transaction Data element) is expected to include a specific child element <SbsqntTxId> (Subsequent Position UTI). This error will be generated if <SbsqntTxId> is missing from the XML output.

For instance, if the client’s input data is incomplete, it may result in missing elements in the XML output. In such cases, our XML generator has a missing elements flagger to alert us when this error occurs.

Example XSD<xs:element name=”TxData”>
        <xs:complexType>
                <xs:sequence>
                        <xs:element name=”SbsqntTxId” type=”xs:string” minOccurs=”1″/>
                        <!– Other required child elements –>
                </xs:sequence>
        </xs:complexType>
</xs:element>
Incorrect XML Example<TxData>
        …
        <!– Missing required child element ‘SbsqntTxId’ –>
        <XYZ>…</XYZ>
        …
</TxData>
Correct XML Example<TxData>
        …
        <SbsqntTxId>549300QM99I2H4YK1K95P123456789</SbsqntTxId>
        <!– Other required child elements –>
        …
</TxData>

3. Invalid Boolean Value for an Element

This error occurs when an element’s value does not conform to the expected Boolean values (i.e. lowercase ‘true’ or ‘false’).

Example: Reporting Obligation must have lowercase ‘true’/’false’; when it is populated with an uppercase ‘TRUE’/’FALSE’, it generates an error.

Incorrect XML example<RptgOblgtn>TRUE</RptgOblgtn>
Correct XML example<RptgOblgtn>true</RptgOblgtn>

4. Invalid Decimal value scientific notation

This error occurs when an element with a decimal type contains an invalid value, often due to scientific notation present in the element. It typically happens when our client’s input data is truncated or improperly formatted.

Example: Consider an XML element <Amt> representing an amount, which is defined as a decimal type. If the input data contains a value in scientific notation, it will result in an error.

Incorrect XML example<Amt>2e02</Amt>
Correct XML example<Amt>2000</Amt>

5. Pattern Constraint Violation

This error occurs when an element’s value does not match the pattern specified in the XSD schema. It is often encountered in fields like the UTI (Unique Transaction Identifier), where specific patterns must be adhered to.

Example: In EMIR Refit, new rules for the UTI have been introduced, requiring all characters to be uppercase and all characters except the 19th and 20th positions to be alphanumeric. The 19th and 20th positions must be digits only. Previous EMIR standards allowed special characters and were not as strict.

Invalid UTI XML example<UnqTxIdr> 549300QM99I2H4YK1K95_p.123456789</UnqTxIdr>
Correct UTI XML example<UnqTxIdr> 549300QM99I2H4YK1K95P123456789</UnqTxIdr>

6. Enumeration Constraint Violation

This error occurs when an element’s value is not one of the predefined values specified in the XSD schema. Enumeration constraints restrict values to a specific set of options.

Example: The ‘Valuation Method’ field allows only three predefined values: CCPV (Central counterparty valuation), MTMA (Mark To Market valuation), and MTMO (Mark To Model valuation). Any other value will result in an error.

Incorrect XML example<Valtn>
        …
        <Tp>ABCD</Tp> <!– Invalid: value ‘ABCD’ is not allowed –>
        …
<Valtn>
Correct XML example<Valtn>
        …
        <Tp>CCPV</Tp> <!– Correct: one of the allowed values –>
        …
<Valtn>

There are also old EMIR fields like Base Product and Sub Product that were in 2-letter format, which are now in 4-letter format in EMIR refit (e.g., Agriculture in EMIR was ‘AG’ -> in EMIR refit is ‘AGRI’). We have automatic converters in place to convert old EMIR formats to EMIR refit format.

7. Missing Required Attribute

This error occurs when an element is missing an attribute that is required by the XSD schema. This is commonly seen in amount or price fields where specific attributes must be included.

Example: In EU refit where all price fields, such as Price, Strike Price, Notional Amount, etc., require the ‘Ccy’ (Currency) attribute when the price is represented as a monetary value (not in percentage or basis points). If the amount is provided but the currency attribute is missing, an error will occur saying: ‘Amt’ element is missing the required attribute ‘Ccy’.

Invalid XML example<Amt>1000.00</Amt>
Correct XML example<Amt Ccy=”USD”>1000.00</Amt>

8. Invalid Date/Time format

This error occurs when a date or time value does not conform to the expected format specified by the XSD schema. The xs:dateTime type in XSD requires a specific format, such as YYYY-MM-DDTHH:MM:SSZ (e.g., “2024-05-03T06:00:00Z”). Any deviation from this format will result in an error.

Incorrect XML example<RptgTmStmp>2024-05-03 06:00:00</RptgTmStmp>
Correct XML example<RptgTmStmp>2024-05-03T06:00:00Z</RptgTmStmp>

9. Exceeding Maximum Length Constraint

This error occurs when the length of a string element or attribute exceeds the maximum length specified in the XSD schema. The maxLength facet is used to define the maximum number of characters allowed.

Example: In the EU refit XML schema, the element <UTI> (Unique Transaction Identifier) is restricted to a maximum length of 52 characters.

Incorrect XML example<UnqTxIdr>549300QM99I2H4YK1K95P1234567890123456789012301234567890123</UnqTxIdr> <!– Invalid: exceeds maxLength of 52 –>
Correct XML example<UnqTxIdr>549300QM99I2H4YK1K95P123456789</UnqTxIdr> <!– Correct: within the maxLength of 52 characters constraint –>

Summary

XML and the associated XSD validations have added a level of complexity to trade reporting that often requires a firm to seek external assistance in their daily trade reporting process.

Contact TRAction if you think you could benefit from such assistance.

Article Author:

Share:

Stay in the Know

Can You Read This?

TRAction can!

Stay in the Know