2.1. The model elementΒΆ
The top-level element information item in a CellML infoset MUST be an element in the CellML namespace with a local name equal to model.
In this specification, the top-level element is referred to as the model element.
Every
modelelement MUST contain anameattribute.The value of the
nameattribute MUST be a CellML identifier.
See more
The model is the highest level in the CellML file, not including the opening xml tags.
And, just like the Highlander, there can be only one.
These are valid CellML name attributes:
myValidNameis valid (both cases are permitted),
my_other_valid_nameis valid (underscores are permitted), and
this1toois valid (numerals 0-9 are permitted).
These are not valid CellML name attributes:
my invalid nameis not valid (spaces are not permitted),
thisIsInvalidToo!is not valid (special characters other than the underscore_are not permitted),
1amNotValidEitheris not valid (must not begin with a number), and
" "empty string is not valid (a name must be present).
A
modelelement MAY contain one or more additional specific element children, each of which MUST be of one of the following types:A
componentelement;A
connectionelement;An
encapsulationelement;An
importelement; orA
unitselement.
See more
<model name="myModel">
<component name="myFirstComponent"> ... </component>
<component name="aDuplicatedComponentName"> ... </component>
<!-- INVALID: This component is not valid because it has the same name as an existing one. -->
<component name="aDuplicatedComponentName"> ... </component>
<units name="myUnits"> ... </units>
<units name="myOtherUnits"> ... </units>
<units name="aDuplicatedUnitName"> ... </units>
<!-- INVALID This units item is not valid because it has the same name as an existing units item. -->
<units name="aDuplicatedUnitName"> ... </units>
<!-- A model can contain any number of import items. -->
<import />
<import />
<!-- A model can contain any number of connection items, as long as the things they connect are unique. -->
<connection />
<connection />
<encapsulation>...</encapsulation>
<!-- INVALID: A model must contain only ONE encapsulation item. -->
<encapsulation>...</encapsulation>
<!-- INVALID: The only child elements of the model are those stated. -->
<apples> ... </apples>
</model>
A
modelelement MUST NOT contain more than oneencapsulationelements.
See more
The encapsulation of a model defines the nested structure of its components.
This in turn affects which variables have access to which other variables, and allows the modular behaviour to happen at any level.
For this reason, there can be only one encapsulation item in any model.
For more information about encapsulation, please refer to 2.13 The encapsulation element.