This is a selection of rules from CellML 2.0 used as a basis for the CellML 2.0 test set.
-
1.2.1.1 CellML documents must be well-formed XML 1.1.
-
1.2.2.2 Elements and attributes can only appear where the spec explicitly allows them.
-
1.2.3.2 CellML elements must not contain character items other than whitespace.
-
1.2.4.1 All elements must be either in the CellML or the MathML namespace.
-
1.2.4.2 Unless explicitly stated otherwise, attributes are unnamespaced.
-
1.2.5 Every element in the CellML namespace may contain an id attribute.
-
1.3.1.1 Identifiers are only letters, numbers, or underscores.
-
1.3.1.1 Identifiers must begin with a letter.
-
1.3.2.1 Integer strings are base ten.
-
1.3.2.2 Integer string may start with
+or-. -
1.3.2.3 Integer strings can only contain optional sign, plus one or more digits.
-
1.3.3.1 Basic real number strings are base ten.
-
1.3.3.2 Basic real number strings may start with
+or-. -
1.3.3.3 Basic real number strings may contain a
.. -
1.3.3.4 Basic real number strings can only contain an optional
+or-., an optional., and one or more digits. -
1.3.4.2 Real number strings are a basic real number string, optionally followed by an exponent.
-
1.3.4.4 The exponent is
eorE, followed by an integer string.
-
2.1 The top-level element must be a
<model>. -
2.1.1 A
modelmust have anameattribute. -
2.1.1 A
modelnamemust be an identifier. -
2.1.2.1 A
modelmay contain one or morecomponentelements. -
2.1.2.2 A
modelmay contain one or moreconnectionelements. -
2.1.2.3 A
modelmay contain anencapsulationelement. -
2.1.2.4 A
modelmay contain one or moreimportelements. -
2.1.2.5 A
modelmay contain one or moreunitselements. -
2.1.3 A
modelmust not contain more than oneencapsulationelement. -
2.2.1 An
importmust have anxlink:hrefattribute. -
2.2.1 An
importxlink:hrefmust be a valid xlink locator. -
2.2.2.1 An
importmay contain one or moreimport unitselements. -
2.2.2.2 An
importmay contain one or moreimport componentelements. -
2.2.3 The imported model must be different from the importing model.
-
2.3.1 An
import unitselement (<units>) must have anameattribute. -
2.3.1 An
import unitsnamemust be an identifier. -
2.3.1 An
import unitsnamemust not match thenameof any otherunitsorimport units. -
2.3.2 An
import unitsmust have aunits_refattribute. -
2.3.2 An
import unitsunits_ref` must be an identifier. -
2.3.2 An
import unitsunits_refmust match thenameof aunitsorimport units` in the imported model. -
Missing rule: An
import unitsnamemust not match the name of a built-in unit. -
2.4.1 An
import componentelement (<component>) must have anameattribute. -
2.4.1 An
import componentnamemust be an identifier. -
2.4.1 An
import componentnamemust not match thenameof any othercomponentorimport component. -
2.4.2 An
import componentmust have acomponent_refattribute. -
2.4.2 An
import componentcomponent_refmust be an identifier. -
2.4.2 An
import componentcomponent_refmust match the name of acomponentorimport componentin the imported model. -
2.5.1 A
unitsmust have anameattribute. -
2.5.1 A
unitsnamemust be an identifier. -
2.5.1 A
unitsnamemust not match thenameof any otherunitsorimport units. -
2.5.2 A
unitsnamemust not match the name of a built-in unit. -
2.5.3 A
unitsmay contain one or moreunitelements. -
2.6.1 A
unitmust have aunitsattribute. -
2.6.1 A
unitunitsmust be a valid units reference. -
2.6.1.2 A unit definition must not be cyclical.
-
2.6.2.1 A
unitsmay have aprefixattribute. -
2.6.2.1 A
unitsprefixmust be an integer string or a prefix string. -
2.6.2.2 A
unitsmay have amultiplierattribute. -
2.6.2.2 A
unitsmultipliermust be a real number string. -
2.6.2.3 A
unitsmay have anexponentattribute. -
2.6.2.3 A
unitsexponentmust be a real number string. -
2.7.1 A
componentmust have anameattribute. -
2.7.1 A
componentnamemust be an identifier. -
2.7.1 A
componentnamemust not match thenameof any othercomponentorimport component. -
2.7.2.1 A
componentmay contain one or moremathml:mathelements. -
2.7.2.2 A
componentmay contain one or moreresetelements. -
2.7.2.3 A
componentmay contain one or morevariableelements. -
2.8.1.1 A
variablemust have anameattribute. -
2.8.1.1 A
variablenamemust be an identifier. -
2.8.1.1 A
variablenamemust be unique within the component. -
2.8.1.2 A
variablemust have aunitsattribute. -
2.8.1.2 A
variableunitsmust be a valid units reference. -
2.8.2.1 A
variablemay have aninterfaceattribute. -
2.8.2.1 A
variableinterfacemust be "public", "private", "public_and_private", or "none". -
2.8.2.2 A
variablemay have aninitial_valueattribute. -
2.8.2.2 A
variableinitial_valuemust be a number of the name of a local variable. -
2.9.1.1 A
resetmust have avariableattribute. -
2.9.1.1 A
resetvariablemust match the name of avariablein the same component. -
2.9.1.2 A
resetmust have atest_variableattribute. -
2.9.1.2 A
resettest_variablemust match the name of avariablein the same component. -
2.9.1.3 A
resetmust have anorderattribute. -
2.9.1.3 A
resetordermust be an integer string. -
2.9.1.3 A
resetordermust be unique for all resets on the same variable (including connected variables). -
2.9.2.1 A
resetmust contain exactly onereset_valueelement. -
2.9.2.2 A
resetmust contain exactly onetest_valueelement. -
2.10.1 A
test_valuemust contain exactly onemathml:mathelement. -
2.11.1 A
reset_valuemust contain exactly onemathml:mathelement. -
2.12.1 A
mathml:mathmust contain content MathML. -
2.12.2 Only elements from the supported subset are allowed.
-
2.12.3 All
mathml:cielements must contain the name of avariablein the same component. -
2.12.4 All
mathml:cnelements must have acellml:unitsattribute. -
2.12.4 The value of a
cellml:unitsattribute must be a valid units reference. -
2.12.5 All
mathml:cnelements must be of type "real" or "e-notation". -
2.12.5 All
mathml:cnelements must be base ten. -
2.13.1 An
encapsulationmay contain one or morecomponent_refelements. -
2.14.1 A
component_refmust have acomponentattribute. -
2.14.1 A
component_refcomponentmust match the name of acomponentor animport component. -
2.14.1 A
component_refcomponentmust be unique. -
2.14.2 A
component_refmay contain furthercomponent_refelements. -
2.15.1 A
connectionmust have acomponent_1attribute. -
2.15.1 A
connectioncomponent_1must match the name of acomponentorimport component. -
2.15.2 A
connectionmust have acomponent_2attribute. -
2.15.2 A
connectioncomponent_2must match the name of acomponentorimport component. -
2.15.3 A
connectioncomponent_1andcomponent_2cannot have the same value. -
2.15.4 For any two components, there can be at most one
connection. -
2.15.5 A
connectionmay contain one or moremap_variableselements. -
2.16.1 A
map_variablesmust have avariable_1attribute. -
2.16.1 A
map_variablesvariable_1must match the name of avariablein component_1. -
2.16.2 A
map_variablesmust have avariable_2attribute. -
2.16.2 A
map_variablesvariable_2must match the name of avariablein component_2. -
2.16.3 The pair (
variable_1,variable_2) must be unique within theconnection.
-
3.1.1 Each
import unitsorimport componentscreates a distinct infoset. -
3.1.2 A units reference in an import element is resolved within its infoset.
-
3.1.3.1 Connections can be made from local to imported components.
-
3.1.3.2 Connections to child components in the imported model are maintained, connections to sibiling and/or parents are not.
-
3.2.1 A units reference must be an identifier.
-
3.2.2 A units reference must be the name of units defined or imported in the model, or one of the built-in units.
-
3.3.1.1 The
prefixattribute has default value 0. -
3.3.1.1 If the
prefixis an integer, the "prefix value" is that integer. -
3.3.1.1 If the
prefixis a string, the "prefix value" is given by the prefix values table. -
3.3.1.2 The
exponentattribute has default value 1. -
3.3.1.3 The
multiplierattribute has default value 1. -
3.3.3.1 Empty units elements define a new base unit (with exponent 1)
-
3.10.4 Connections cannot connect two variables twice.
-
3.10.5 The connection network must not contain any cycles.
-
3.10.7.1 Connections between sibling components use the public interface.
-
3.10.7.2 In parent-child relations, the parent variable uses the private interface.
-
3.10.7.2 In parent-child relations, the child variable uses the public interface.
-
3.10.9 Connected variables must have compatible units.
-
3.10.10 If two units differ by a scaling factor, this must be taken into account when evaluating the model's mathematics.
-
Missing rule: Variables can't have value
trueorfalse