Customise a LIXI2 Schema using the LIXI Python Package

Customise a LIXI2 Schema using the LIXI Python Package

Posted on: February 21, 2020

The LIXI2 standard is a very comprehensive standard, with over 700 elements and more than 3000 attribute. It covers many types of credit products, multiple types of borrowers, and numerous transactions that occur along the lending chain. A huge number of scenarios are covered by the standards. But, no single use case will ever require all the schema items.

Our customisation by restriction framework allows you to create a LIXI2 schema that is specifically tailored to your particular use case. The custom schema will only include the items you use, restrict the accepted data to your specific requirements, and generate custom HTML schema documentation.

Features of the Customisation by Restriction framework include:

  • Exclude unnecessary items from the schema
  • Restrict the data each attribute can accept
  • Control the number of repeating elements
  • Set custom value ranges for numeric attributes
  • Inject custom documentation into the schema
  • Generate customised HTML documentation

How to create your Customised Schema

1) Install the LIXI Python package

pip install lixi

2) Download the LIXI2 schema you intend to customise.

Links to download LIXI2 schemas can be found here: LIXI standards Release History.

3) Create a customisation instructions file

Details of the types of customisation instructions can be found in LIXILab in the project CustomisationByRestriction (available to logged in LIXI members).

Here is an example customisation instructions file:

<Customisations LIXICode="TRAINING"
               CustomHeading="LIXI Blog 2020">
<!-- Example 1: Exclude from Schema -->
<CustomiseItem Exclude="Yes">
<!-- Example 2: Customised Documentation -->
    <CustomDocumentation>LIXI Blog 2020</CustomDocumentation>
<!-- Example 3: Optional to Mandatory -->
<CustomiseItem OptionalToMandatory="Yes">
    <CustomDocumentation>Mandatory Attribute.</CustomDocumentation>
<!-- Example 4: String to List -->
<CustomiseItem StringToList="Yes">
    <Enumeration Definition="LIXI Limited">LIXI</Enumeration>
    <Enumeration Definition="CUA">CUA</Enumeration>
<!-- Example 5: String to Pattern -->
<CustomiseItem StringToPattern="Yes">
    <CustomDocumentation>Must be a 6 digit number.</CustomDocumentation>
<!-- Example 6: Min and Max Occurences -->
<CustomiseItem CustomMaxOccurs="Yes" CustomMinOccurs="Yes">
    <CustomDocumentation>One loan per application.</CustomDocumentation>
<!-- Example 7: Include in the Schema -->
<CustomiseItem Include="Yes">
    <CustomDocumentation>Only accepting applications for:
- Travel and holidays
- Purchase of household and personal goods
<!-- Example 8: Custom Currency Range -->
<CustomiseItem CustomCurrencyRange="Yes">
    <CustomDocumentation>Loan amount must be from 1000 to 1 million dollars.</CustomDocumentation>
<!-- Example 9: Custom Percentage Range -->
<CustomiseItem CustomPercentageRange="Yes">
    <CustomDocumentation>Introductory margin must be from 0.5 to 1 percent.</CustomDocumentation>

4) Perform the customisation.

Execute the following Python code (making sure to provide the correct path and filename to the schema you wish to customise).

import lixi
custom_schema = lixi.get_custom_schema(

This code will execute the customisation on the LIXI CAL 2.26.25 annotated schema. The customised schema will be saved to the working directory with the name custom_schema.xsd and the customised documentation will output to the directory custom_docs. Custom documentation can be viewed locally in your browser by openeing the index.html file.

Related Blogs

Written by:
John Matthews, LIXI Technical Lead
First Published: February 21, 2020