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, and with a model element as its parent.

  1. Every units element MUST contain a name attribute. The value of the name attribute MUST be a valid CellML identifier.

    The value of the name attribute MUST NOT be identical to 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 equal to the name of any of the units listed in the Built-in units table.
  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 Unit element section 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>