Example “LGCS”

Introduction

This example illustrates how the DD8723-5 XML format may be extended. This example suggests that extensions should be implemented using XML Schema’s extensions.

The XML Schema was designed so that each key component is defined as a reusable data-type. The XML Schema contains one “complex type” for each class defined in the model. These “complex types” can be extended to fulfill a specific functional requirement.

This is illustrated in this example with the Thesaurus LGCS (Local Government Classification Scheme). This vocabulary requires an additional attribute to the class concept.

To create an extension, the following should be implemented

  1. The first step would be to create an XML Schema which contains the definition of the extended data types. For example, the following XML Schema LgscConceptStructure.xsd contains the definition of the complex type “LgscConceptStructure” which extends the original “concept” complex type. The complex type “LgscConceptStructure” must be defined under a different namespace to avoid any conflict.)
  2. The next step is to assign the newly created complex-type to the concepts defined in the XML file. This is done as followed:
    • The URL of the schema used by the XML file must point to the XML Schema which contains the extension.
    • The attribute xsi:type=”esd:LgscConceptStructure” needs to be applied to all the concepts that use the extended concept. (“esd” is the prefix of the namespace under which the complex type is defined.)

With this approach:

  • The structure of the extension is clearly defined in a schema that can be used for documentation purposes or which can even be further extended by other XML Schemas.
  • An extension (in XSD terms) does not make any modification to the extended type; i.e. it can only add new elements and attributes but cannot modify or removed existing elements or attributes. This guaranties that processing tools which do not support the extensions will still be able to use the XML file by ignoring the additional elements and attributes.

DD8723-5 XML Format

The XML file can be downloaded from the following URL.
Example.xml

Alphabetical display

The transformation implemented to generate the alphabetical display can be used on the extended XML file.

The transformation is available at the following location.
DD8723-5ToAlphabeticalDisplay.xsl

The result of the transformation is available here.
AlphabeticalDisplay.txt

Hierarchical display

The transformation implemented to generate the hierarchical display can be used on the extended XML file.

The transformation is available at the following location.
DD8723-5ToHierarchicalDisplay.xsl

The result of the transformation is available here.
HierarchicalDisplay.txt

Leave a Reply

Your email address will not be published. Required fields are marked *