2.5. The units elementΒΆ

A units element information item (referred to in this specification as a units element) is an element in the CellML namespace with a local name equal to units, which appears as a child of a model element.

  1. Every units element MUST contain a name attribute.

    1. The value of the name attribute MUST be a CellML identifier.

    2. The value of the name attribute MUST NOT be identical to the value of the name attribute of any other units element or import units element in the CellML infoset.

  1. The value of the name attribute MUST NOT be identical to the name of any of the units listed in Table 3.1: Built-in units (see 3.2 Units references).

  1. A units element MAY contain one or more unit element children.

See more

The best way to understand how units work is to read the informative sections within the 2.6 The unit element in the next section, which defines their child unit items.

The following examples show examples of what is not permitted when defining units items.

<!-- The units name attribute is not a valid CellML identifier. -->
<units name="I'm not valid!"> ... </units>

<!-- Duplicted local units names are not allowed. -->
<units name="duplicatedName"> ... </units>
<units name="duplicatedName"> ... </units>

<!-- Duplicated name of an imported units item is not allowed. -->
<import xlink:href="handyUnitsForImport.cellml">
    <units units_ref="myCustomUnits" name="duplicatedName">
</import>

<!-- Duplicating the name of built-in units is not allowed. -->
<units name="metre"> ... </units>