Modeling Codelists in XML

 

Code Lists Section

Working with code lists is a special thing. On the one hand code lists can be treated as semantic datatypes because they define the value space of terms. On the other hand they can be treated as rules, because often certain codes are only applicable under certain conditions.

Even more important to consider is that often single codes are loaded with business semantics of detailed meaning.

External Code Lists

There many ways third parties publish code lists. One such technical way is using the Genericode XML Syntax as defined by OASIS.

Use as is

<m:term id="BT-98" datatype="code">
  <m:name>Document level allowance reason code</m:name>
  <m:description>Der als Code angegebene Grund für den Nachlass auf der Dokumentenebene.</m:description>
</m:term>

Read datatype="code" as the value must represent a code. Here any facet describes the coding patterns used by the codleist often they are just numbers or something with common prefix etc… e.g.

Local Definition

Use a subset of codes

<m:term id="BT-95" datatype="code">
  <m:name>Document level allowance VAT category code</m:name>
  <m:description>Ein Code für das Umsatzsteuermerkmal, das auf den Nachlass auf Dokumentenebene
        anzuwenden ist. Anmerkung: Folgende Codes aus der Codeliste UNTDID 5305 müssen verwendet
        werden: • S (Standard rate) • Z (Zero rated goods) • E (Exempt from tax) • AE (VAT Reverse
        Charge) • K (VAT exempt for EEA intra-community supply of goods and services) • G (Free
        export item, tax not charged) • O (Services outside scope of tax) • L (Canary Islands
        general indirect tax) • M (Tax for production, services and importation in Ceuta and
        Melilla)
  </m:description>
</m:term>