Encoding Units in XML

1. Introduction

According to ISO standards, there are three types of units: base units, conventional units, and derived units.

Base units are defined as units of measurement that cannot be derived by combining other base units within the same system of units. For example, in the International System of Units (SI), the meter (length), the second (time), the kilogram (mass), etc., are considered base units. Therefore, the set of base units depends on the system of units being used, allowing for different base units for the same type of measurement. For instance, in the case of mass units in the International System of Units (SI), the base unit is the kilogram, while in the Unified Code for Units of Measure (UCUM), it is the gram.

Conventional units are those that are neither base units nor direct combinations of base units. Examples include the electronvolt, feet, nautical miles, and any measurement derived from base units like milligrams, hours, etc. To define a conventional unit, a conversion factor or formula to another preferred unit is needed.

Derived units are defined by the combination of other units and are used for quantities different from those corresponding to base units, such as Hertz (s⁻¹) or Newton (kg·m/s²). Generally, derived units are intended to be directly based on the base units of a specific system. If a derived unit is not based on the base units of the system, it is better to use the concept of a conventional unit.

There is some overlap between derived and conventional units, and sometimes it is easier or more convenient to document a unit of measure as either derived or conventional.

2. Encoding Units in XML:

Based on the introduction, there are three general configurations for documenting units in XML. The basic structure of each, along with variations, is shown below using some examples:

2.1. Base Units

2.2. Conventional Units

2.3. Derived Units