XX1 Lookup Table Configuration (Encode/Decode)

XX1 provides an encode/decode functionality, which allows you to implement fast lookup tables on the server. They are used for example to decode airport, airlines and equipment names. They can also be used for multi national language support and normalization of error codes/messages.

The XX1 JavaScript engine and XSL extensions provide global functions that work against those tables.

All lookup tables are in XML text file format and loaded at startup.

Lookup Index File Configuration

The main index with references to all tables is configured in the main configuration file xxscfg.xml under the <lookup> section.

 

NodeDescription
te

Table entry definition.

Attributes:

  • name: logical table name to be used in the "Decode" functions.
cfgXML file name containing the table

Example:

 

<edt>
<te name = "Airports">
<cfg>airports.xml</cfg>
</te>
<te name = "Equipments">
<cfg>equipments.xml</cfg>
</te>
</edt>

 

Lookup Table File Configuration

The actual lookup tables have the following format.

NodeDescription
ceCode entry definition
ce/codeinput value for Decode functions
ce/desc

return value for Decode functions or

compare value matched against pattern in Encode functions

cd/data(optional) free use XML data block or text block returned with Encode or to be used for extended selection with Decode function

Example:

<edt name="Airports">
<ce>
<code>AAA</code>
<desc>Anaa</desc>
<data>
<Country>PF</Country>
</data>
</ce>
<ce>
<code>AAC</code>
<desc>Al Arish</desc>
<data>
<Country>EG</Country>
</data>
</ce>
</edt>

<edt>
    <te name = "Airports">
        <cfg>airports.xml</cfg>
    </te>
    <te name = "Equipments">
        <cfg>equipments.xml</cfg>
    </te>
</edt>

Table entry definition. Attribute "name" specifies the logical table name to be used in the "Decode" functions.