Skip to content
Kaleidl

MN 112 · Label Auto-assignment Definition Language

The LADL specification

New here? Start with the guide.

MN 112 specifies the Label Auto-assignment Definition Language (LADL), a declarative model under which a publisher states how a document family assigns labels, and a conforming engine evaluates that statement against a content tree and produces every label and every cross-reference form. This page states the contract that the Kaleidl runtimes implement: the three model trees, the six profile instance types with their attributes, the template placeholders, the condition types, the labeling algorithm with its counter-scoping rules, the sequence semantics, the vocabulary contract, both profile realizations, and one document labeled end to end.

Every profile excerpt on this page is drawn from the conformance vectors, and every table of produced labels is the output of a real engine run against those vectors; the note under each table names the run that pins the values. The specification covers label assignment only. The engine ships no bundled profiles, because each publisher's labeling scheme is a profile supplied by the flavor that needs it, and the label vocabulary is language data supplied by the host document rather than by a profile. MN 112 is a draft specification; where the draft text admits more than one reading, the Kaleidl engines resolve the reading as documented in the reference engine, and each resolution is testable against the conformance vectors.

Scope

A LADL profile declares, as data, how a family of documents assigns labels: clause and annex numbering, figure and table captions, formula and list numbering, note and example counting, footnote sequences, numbered bibliography entries, and ordered-list schemes. A conforming runtime parses the profile, evaluates it against the content tree the host supplies, and returns one label per labeled element in two forms — the assignment form, which is the label as it is printed at the element, and the reference form, which is the label as a cross-reference to that element is printed elsewhere.

The runtime evaluates one profile against one document at a time, and it derives everything from the profile and the tree: it never infers scoping from the shape of the tree, never matches context by element name behind the profile's back, and never substitutes a default labeling scheme when a profile rule is missing. Where a rule cannot be evaluated — an unknown vocabulary key, a reference to an undefined instance, a sequence asked for a position it cannot produce — the runtime raises an error instead of publishing a fallback label.

The three model trees

LADL models a labeling scheme as three instance trees, and every part of the model lives in one of them. The content tree arrives from the host and describes the elements being labeled: each element carries an identity, a type that decides which labeller can label it, its children, and — where it has children to be labeled — a declared association naming the context that scopes them. The context tree comes from the profile: LabelContext instances linked by a parent reference, the way the document itself nests. The labeller tree binds the two: each labeller serves one element type within one context, draws its value from a sequence, renders it through one or more templates, and may name a parent labeller so that a nested element knows the element it hangs from.

The scoping structure is declared, never inferred. A clause carries an association to the clause context, an annex clause carries an association to the annex clause context, and the engine resolves an element's applicable context by walking from the element through its ancestors to the nearest declared association. Because the host declares the structure, the same profile labels an arbitrary document family: the profile states the rules, and the tree states where they apply.

Profile instances

A profile is a set of typed instances, and six instance types make up a profile. The attribute set of each is fixed. The tables below state the attributes of each type as the reference models declare them; the YAML realization maps these attributes one for one under properties. LabelContext additionally declares optional element and labellers attributes, which the flagship profiles leave unused: the binding runs the other way, and each labeller names the context it serves through its own context reference.

LabelStyle

The root instance. One style references every labeller, sequence, template and context the scheme uses.

AttributeTypeMeaning
namestringThe style name.
labellersreference listThe labellers of the style, referenced by identifier in the form "id:clause_labeller".
sequencesreference listThe sequences the style uses, referenced by instance name.
templatesreference listThe label templates the style uses, referenced by instance name.
contextsreference listThe label contexts the style uses, referenced by instance name.
definitionstringFree-text scope statement of the style.

LabelContext

Defines a labeling scope. Context instances form the context tree through the parent reference.

AttributeTypeMeaning
namestringThe context name, for example "clause" or "annex_clause".
parentreferenceThe enclosing context; omitted on the document context, which is the root.
definitionstringFree-text statement of what the context scopes.

Labeller

Labels one element type within one context. Labellers form the labeller tree through the parent reference.

AttributeTypeMeaning
idstringThe labeller identifier the style references.
sequencereferenceThe sequence that produces the value at each position; names a profile instance or a built-in sequence.
contextreferenceThe context whose carrier elements scope this labeller's counters.
typestringThe content-element type the labeller labels, for example "clause" or "note".
parentreferenceOptional parent labeller; it supplies the %pn value and anchors the hierarchical counter scope.
templatereference listOne label template, or an ordered list of them for conditional selection.
global_templatereference listThe same shape, for the cross-reference form of the label.
definitionstringFree-text statement of the labeller's rule.

LabelTemplate

Constructs the label string from labeller values, fixed text and vocabulary words.

AttributeTypeMeaning
patternstringThe pattern string; carries the placeholders described under Template patterns.
directionstring, default "ltr"Declared text direction of the rendered label.
conditionLabelContextConditionOptional condition; see Conditions and template selection.
definitionstringFree-text statement of the template's purpose.

NumericSequence

A monotonic sequence of numeric values, rendered in one of the labeling formats.

AttributeTypeMeaning
initial_valueinteger, default 1The value at position 1.
incrementinteger, default 1The step between successive positions.
formatstring, default "decimal"The labeling format: decimal, roman_upper, roman_lower, alpha_upper, alpha_lower, arabic_indic, chinese, japanese or korean.
cycle_lengthintegerWhen present, the raw value is decomposed bijectively into digits of this radix, and each digit is rendered in the format.
base_sequencereferenceWhen present, the raw value is rendered through the referenced sequence instead of the format attribute.
char_directionstring, default "ltr"Declared direction of the rendered characters.
definitionstringFree-text statement of the sequence.

CharacterSequence

A fixed list of characters, with a declared rule for positions past the list end.

AttributeTypeMeaning
charactersstring listThe characters in order, for example the Cyrillic upper alphabet.
expansion_rulestringOne of repeat_label, prepend_prefix, double_character, append_suffix or none; see Expansion rules.
expansion_prefixstring listThe prefix or suffix characters used by prepend_prefix and append_suffix; when absent, the characters themselves are used.
char_directionstring, default "ltr"Declared direction of the characters.
directionstring, default "ltr"Declared direction on the sequence itself; where both are present, it takes precedence.
definitionstringFree-text statement of the sequence.

The excerpt below is a verbatim part of the MN 112-A worked profile, the ISO/IEC Directives Part 2 scheme that the conformance vectors carry as mn112a-label-style.yaml. Two bindings in it carry the clause scheme: the subclause labeller binds the clause context, so it labels subclauses only inside clauses, and it names the clause labeller as its parent, so the parent value it substitutes for %pn is the clause's own number and the pattern %pn.%n renders 1.1 and 1.2 under clause 1. The annex bindings in the same vector apply the same shape inside annexes, and render A.1 and A.1.1, as the worked document below shows.

# Clause labeling — mn112a-label-style.yaml, verbatim excerpt
- name: ClauseContext
  type: LabelContext
  properties:
    name: "clause"
    parent: {ref: DocumentContext}

- name: SubclauseContext
  type: LabelContext
  properties:
    name: "subclause"
    parent: {ref: ClauseContext}

- name: ClauseLabelTemplate
  type: LabelTemplate
  properties:
    pattern: "{clause} %n"

- name: SubclauseLabelTemplate
  type: LabelTemplate
  properties:
    pattern: "%pn.%n"

- name: ClauseLabeller
  type: Labeller
  properties:
    id: "clause_labeller"
    sequence: {ref: DecimalNumericSequence}
    context: {ref: DocumentContext}
    type: "clause"
    template: {ref: ClauseLabelTemplate}
    global_template: {ref: ClauseGlobalLabelTemplate}

- name: SubclauseLabeller
  type: Labeller
  properties:
    id: "subclause_labeller"
    sequence: {ref: DecimalNumericSequence}
    context: {ref: ClauseContext}
    parent: {ref: ClauseLabeller}
    type: "subclause"
    template: {ref: SubclauseLabelTemplate}
    global_template: {ref: SubclauseGlobalLabelTemplate}

Source: the conformance vector mn112a-label-style.yaml, verbatim.

Template patterns

A pattern is a string that mixes fixed text with placeholders, and the renderer substitutes each placeholder with a value bound from the element's labeling state. Five placeholders exist, and the table states each one's binding.

PlaceholderBinding
%nThe sequence value at the element's position — its own number.
%pnThe hierarchical value of the nearest enclosing element labeled by this labeller's parent chain: 1.2 for a subclause under clause 1, A.1 for an annex clause under Annex A.
%parentThe rendered global label of the context element that anchors the labeller's counter frame — the enclosing section a reference points from.
%selfThe element's own local label, bound inside global templates so a reference can combine the section with the local form.
{key}A label vocabulary key, resolved through the host document's i18n table with the English default vocabulary as the fallback.

Two placeholders fail loudly. A pattern that uses %pn on an element for which no parent value is bound is a profile error, and the engine raises it rather than rendering a broken number; a pattern that uses an unknown {key} fails the same way. The %parent and %self placeholders render as the empty string when no value is bound.

Every labeller may carry a global_template alongside its local one, and this is what separates the assignment form from the reference form. The ISO/IEC style renders a clause's assignment as the bare number and its reference as the number with the term word, while the MN 112-A worked style carries the term word in both. Where a labeller declares no global template, the reference equals the assignment. The verified forms are:

Profile and elementAssignmentReference
ISO/IEC style — clause1Clause 1
ISO/IEC style — annex clauseA.1Clause A.1
MN 112-A worked style — clauseClause 1Clause 1
Vocabulary style with a French host table — annex clauseA.1Article A.1

Engine output: golden-tree against the ISO/IEC style, golden-tree and mn112a-tree against the MN 112-A style, and vocab-tree against the vocabulary style with the French host table.

The reference forms anchor at the enclosing section through %parent: the lone note of subclause 1.1 references 1.1, NOTE, while the first of two notes directly in clause 1 references Clause 1, NOTE 1, because the note's counter is anchored by the element that declared its context — the subclause in the first case, the clause in the second.

Conditions and template selection

A template may carry a condition, which is a LabelContextCondition naming one of three types and an integer threshold. The condition is evaluated against the count of like-labeled elements within the same counter scope.

Condition typeHolds when
element_count_gtHolds when the count of like-labeled elements under the same counter scope is greater than threshold.
element_count_eqHolds when the count equals threshold.
element_count_ltHolds when the count is less than threshold.

The engine walks the tree once, plans and counts first, and renders afterwards, so each conditional template is evaluated against the final count of like-labeled siblings in its scope, not against the count at the moment the element was visited. Selection takes the first template whose condition holds; when no condition holds, the first unconditional template is selected. That one mechanism carries the ISO/IEC single-note rule, which the flagship profile states as an ordered pair — the unconditional {note} and the conditional {note} %n under element_count_gt with threshold 1 — and the same pair is applied to examples:

ElementSituationAssignment
c1_s1_n1the only note of subclause 1.1NOTE
c1_n1first of two notes in clause 1NOTE 1
c1_n2second of two notes in clause 1NOTE 2

Engine output: mn112a-tree against the MN 112-A worked profile.

Notes to terminological entries take the opposite rule by design: their labeller binds a single unconditional template whose pattern is {note_to_entry}, which is why the note to an entry is numbered even when it is the only one. The vocabulary, not the profile, decides the wording, and the English default renders it as Note 1 to entry.

The labeling algorithm

The engine walks the content tree depth-first and resolves each element in four steps, in a manner that:

  1. finds the element's applicable context — the element's own declared association first, then the declared associations of its ancestors, nearest first;
  2. skips any association whose context binds no labeller for the element's type, because such an association scopes the element's descendants without labeling the element;
  3. applies the labeller bound to that context and type: the counter increments, the sequence produces the value at the new position, and the first template whose condition holds renders the string; and
  4. keys the counter on the element that declared the context, the labeller, and the parent hierarchical value, so like-labeled elements under different carriers number independently.

The second step is what lets one context serve two roles. In the worked document below, the terminological entry c1_e1 is a subclause declared in the term-entry context. The term-entry context binds a note labeller but no subclause labeller, so the entry itself skips the association, falls through to the enclosing clause context, and is labeled 1.3 by the subclause labeller — while its note resolves the term-entry context as its nearest association, is labeled Note 1 to entry by the note-to-entry labeller, and references as 1.3, Note 1 to entry.

Because counters are keyed on the declaring carrier element, numbering restarts wherever a new carrier begins. Annexes A and B each number their clauses, figures and tables from one, and a list under the next clause numbers its items from a) again. Labellers that name a parent labeller additionally restart per enclosing parent element, which produces the ISO/IEC ordered-list ladder over four levels and the em-dash bullet for unordered items:

ElementPositionLabel
li1first item of the lista)
li1_1nested in li11)
li1_1_1nested in li1_1i)
li1_1_1_1nested in li1_1_1a)
li1_1_2second child of li1_1ii)
li1_2second child of li12)
li2second item of the listb)
li3third item of the listc)
li3_1nested in li31)
liL2_u1unordered item of the second list—

Engine output: list-levels-tree against the ISO/IEC style vector.

The %pn value is the hierarchical path of the nearest enclosing element labeled by the labeller's parent chain, with the chain's values joined by a dot. Where the parent labeller's own binding does not cover the enclosing element, the engine falls back to the nearest ancestor of the parent labeller's element type, so a subfigure nested in a figure that is labeled by the annex figure labeller still resolves its parent and prints Figure A.1 a).

Errors

The specification states no fallbacks: each unresolvable situation is an error, and the runtimes raise it. The table states each situation with the error the vendored engine raises for it.

SituationEngine behavior
A pattern uses a {key} that is in neither the host table nor the default vocabularyResolutionError: template "{nothere} %n" uses {nothere} but the key is in neither the labels dictionary nor the default vocabulary
A catalog value references a message the vocabulary does not defineResolutionError: catalog message references unknown message "nowhere"
A pattern uses %pn and no parent value is bound for the elementResolutionError: template "%pn.%n" uses %pn but the labeller has no parent labeller bound for this element
A CharacterSequence with expansion_rule none is asked for a position past its charactersSequenceExhaustedError: sequence exhausted at position 3 (expansion_rule none)
A labeller references a sequence the profile neither declares nor names among the built-insResolutionError: undefined sequence: "Missing"

Sequences

A compliant runtime provides fifteen built-in sequences, and every value below is engine output: numeric sequences are shown at positions 1 to 5 and again at 26 to 28, and character sequences at positions 1 to 3 and at the last position of their character list with the two positions past it. The two Arabic spellings render the same Arabic-script digits; the second carries the declared char_direction rtl, and rendering emits logical order in both cases, with display left to Unicode bidi.

Built-in sequenceKindValues
DecimalNumericSequenceNumeric · decimal1 · 2 · 3 · 4 · 5 · … · 26 · 27 · 28
ArabicNumericSequenceNumeric · arabic_indic١ · ٢ · ٣ · ٤ · ٥ · … · ٢٦ · ٢٧ · ٢٨
ArabicIndicNumericSequenceNumeric · arabic_indic · rtl١ · ٢ · ٣ · ٤ · ٥ · … · ٢٦ · ٢٧ · ٢٨
RomanUpperNumericSequenceNumeric · roman_upperI · II · III · IV · V · … · XXVI · XXVII · XXVIII
RomanLowerNumericSequenceNumeric · roman_loweri · ii · iii · iv · v · … · xxvi · xxvii · xxviii
AlphaUpperNumericSequenceNumeric · alpha_upperA · B · C · D · E · … · Z · AA · AB
AlphaLowerNumericSequenceNumeric · alpha_lowera · b · c · d · e · … · z · aa · ab
ChineseNumericSequenceNumeric · chinese一 · 二 · 三 · 四 · 五 · … · 二十六 · 二十七 · 二十八
JapaneseNumericSequenceNumeric · japanese一 · 二 · 三 · 四 · 五 · … · 二十六 · 二十七 · 二十八
KoreanNumericSequenceNumeric · korean일 · 이 · 삼 · 사 · 오 · … · 이십육 · 이십칠 · 이십팔
CyrillicUpperCharacterSequenceCharacter · 32 letters · prepend_prefixА · Б · В · … · Я · АА · АБ
CyrillicLowerCharacterSequenceCharacter · 32 letters · prepend_prefixа · б · в · … · я · аа · аб
GreekUpperCharacterSequenceCharacter · 24 letters · prepend_prefixΑ · Β · Γ · … · Ω · ΑΑ · ΑΒ
GreekLowerCharacterSequenceCharacter · 24 letters · prepend_prefixα · β · γ · … · ω · αα · αβ
HebrewNumericSequenceCharacter · 22 letters · prepend_prefixא · ב · ג · … · ת · אא · אב

Engine output: each sequence driven through the vendored engine over a flat element list.

Profile-declared sequence instances

Beyond the built-ins, a profile may declare its own sequence instances, and the attributes compose: the raw value at a position is initial_value + (position - 1) * increment, from which cycle_length, base_sequence or format produces the rendered value. The verified rows are:

DeclarationValues at positions 1, 2, 3
initial_value 3 · increment 3 · format "decimal"NOTE 3 · NOTE 6
initial_value 1 · increment 1 · format "decimal" · cycle_length 2Table 1 · Table 2 · Table 11
increment 2 · base_sequence DecimalNumericSequence1) · 3) · 5)

Engine output: profiles with these instances, run against element lists through the vendored engine.

A cycle_length of 2 renders the raw value as a bijective two-digit decomposition, which is why the third table prints Table 11: the raw value 3 decomposes into the digits 1 and 1, each rendered in the format. A base_sequence renders the raw value through the referenced sequence, superseding the format attribute; the third row declares an increment of 2 over the decimal base, and produces 1, 3, 5.

Expansion rules

A character sequence lists its characters in order and declares one expansion rule for the positions past the list end. The verified rows each use a two-character base list, so the third value and beyond exercise the rule; the values come from the conformance sequence vector, where four ordered-list levels carry exactly these sequences.

RuleBehaviorValues at positions 1–5
repeat_labelCycles the base characters.F E F E
double_characterRepeats the character once more on each cycle past the list.A B AA BB AAA
prepend_prefixPrepends the expansion_prefix characters cyclically; the built-in character sequences declare no prefix, so the characters themselves are prepended.C D XC XD YC YD (declared prefix X, Y)
append_suffixAppends the expansion_prefix characters as suffixes, cyclically.G H GP HP GQ (declared suffix P, Q)
noneRaises the sequence-exhausted error at the first position past the list.—

Engine output: sequences-tree against the MN 112 Labeling Sequences vector (F E / A B / C D / G H base lists).

Format renderings

The format attribute renders a positive integer in one of nine systems, and the arithmetic carries two documented conventions. Alphabetic formats are bijective in the spreadsheet manner, so 26 renders Z and 27 renders AA; the East-Asian formats render formal compound numerals, in which the unit is dropped before the tens marker only, so 10 renders 十, 21 renders 二十一, and 100 renders 一百. A sequence value that is not positive is an error.

CallRenders
roman_upper(4)IV
roman_upper(9)IX
roman_upper(1973)MCMLXXIII
alpha_upper(26)Z
alpha_upper(27)AA
alpha_upper(28)AB
arabic_indic(4)٤
arabic_indic(12)١٢
chinese(10)十
chinese(21)二十一
chinese(100)一百
chinese(108)一百八
japanese(2)二
korean(3)삼

Engine output: real formatter calls in the vendored engine.

The label vocabulary

Term words in a pattern are not literals — they are {key} tokens, and the engine resolves each key through a label vocabulary. The vocabulary is the host document's i18n table, and profiles carry the labeling scheme, never the words. A key present in the host table is resolved from it; a key absent from the host table falls back to the English default vocabulary, which the table below states in full; and a key present in neither is a profile error.

KeyEnglish default
clauseClause
subclauseClause
annexAnnex
appendixAppendix
sectionSection
figureFigure
tableTable
formulaFormula
inequalityInequality
noteNOTE
note_xrefNOTE
note_to_entryNote { $n } to entry
note_to_entry_xref{ $parent }, Note { $n } to entry
exampleEXAMPLE
example_xrefEXAMPLE
termexampleEXAMPLE
listList
introductionIntroduction
norm_annexnormative
inform_annexinformative

Catalog values are Fluent (FTL) message patterns resolved by the rhoella engine. Placeables of the form { $n }, { $pn }, { $parent } and { $self } bind from the labeller's values, and a catalog value may reference another catalog message, which resolves within the catalog formed by the default vocabulary and the host table. A catalog value that references a message the vocabulary does not define is a profile error and the engine raises it, so a published document never carries a question-marked fallback for a label.

Because the vocabulary is host data, the same profile labels the same document in another language without change. The conformance suite runs the worked document a second time against a French table, and the verified pairs are:

ElementEnglishFrench
clause 1Clause 1Article 1
annex AAnnex AAnnexe A
example of subclause 1.1, assignmentEXAMPLEEXEMPLE
note to entry, assignmentNote 1 to entryNote 1 à l'article
note to entry, reference1.3, Note 1 to entryNote 1 à l'article 1.3
note 1 of clause 1, referenceClause 1, NOTE 1Article 1, NOTE 1

Engine output: mn112a-tree against the MN 112-A worked profile, run without a host table and again with the French table of the vectors.

A worked document

The worked document exercises every labeling category of the ISO/IEC scheme at once: an Introduction whose subclauses number 0.1 and 0.2 while the Introduction itself carries no clause number; clauses with conditional notes and examples, terminological entries with always-numbered notes to entry, figures and tables whose own notes restart per figure and table, a footnote pair that runs sequentially through the document, and an ordered list; two annexes that restart independently, with a hierarchically numbered annex subclause and an annex figure; and a numbered bibliography. The tree excerpt below is real vector content, and the table lists all forty labels the engine produces for it.

{
  "type": "document",
  "id": "doc",
  "context": "DocumentContext",
  "children": [
    {
      "type": "introduction", "id": "intro",
      "context": "IntroductionContext",
      "children": [
        { "type": "subclause", "id": "intro_s1" },
        { "type": "subclause", "id": "intro_s2" }
      ]
    },
    {
      "type": "clause", "id": "c1", "context": "ClauseContext",
      "children": [
        {
          "type": "subclause", "id": "c1_s1",
          "context": "SubclauseContext",
          "children": [
            { "type": "note", "id": "c1_s1_n1" },
            { "type": "example", "id": "c1_s1_x1" }
          ]
        },
        { "type": "subclause", "id": "c1_s2", "context": "SubclauseContext",
          "children": [ { "type": "note", "id": "c1_s2_n1" } ] },
        { "type": "subclause", "id": "c1_e1", "context": "TermEntryContext",
          "children": [ { "type": "note", "id": "c1_e1_n1" } ] },
        { "type": "note", "id": "c1_n1" },
        { "type": "note", "id": "c1_n2" },
        { "type": "footnote", "id": "c1_fn1" }
      ]
    },
    // clause 2 carries two figures (one with a subfigure, notes on
    // both), a table with two notes, a formula, a footnote and a list;
    // annexes A and B carry annex clauses with notes, examples, a
    // subclause, a figure and a list; the bibliography carries two
    // numbered items. The vector ships the full tree, and the table
    // below lists every label it produces.
  ]
}

Source: the conformance vector mn112a-tree.json, excerpted.

ElementRoleAssignmentReference
intro_s1Introduction subclause0.10.1
intro_s2Introduction subclause0.20.2
c1clause 1Clause 1Clause 1
c1_s1subclause of clause 11.11.1
c1_s1_n1note of subclause 1.1NOTE1.1, NOTE
c1_s1_x1example of subclause 1.1EXAMPLE1.1, EXAMPLE
c1_s2subclause of clause 11.21.2
c1_s2_n1note of subclause 1.2NOTE1.2, NOTE
c1_e1terminological entry 1.31.31.3
c1_e1_n1note to the entryNote 1 to entry1.3, Note 1 to entry
c1_n1note of clause 1NOTE 1Clause 1, NOTE 1
c1_n2note of clause 1NOTE 2Clause 1, NOTE 2
c1_fn1footnote in clause 111
c2clause 2Clause 2Clause 2
f1figure in clause 2Figure 1Figure 1
f1_asubfigure of figure 1Figure 1 a)Figure 1 a)
f1_n1first note of figure 1NOTE 1Figure 1, NOTE 1
f1_n2second note of figure 1NOTE 2Figure 1, NOTE 2
f2figure in clause 2Figure 2Figure 2
f2_n1only note of figure 2NOTEFigure 2, NOTE
t1table in clause 2Table 1Table 1
t1_n1first note of table 1NOTE 1Table 1, NOTE 1
t1_n2second note of table 1NOTE 2Table 1, NOTE 2
eq1formula in clause 2(1)Formula (1)
c2_fn1footnote in clause 222
L1list in clause 2List 1List 1
li1ordered item of L1a)a)
ax_afirst annexAnnex AAnnex A
ax_a_c1clause of Annex AA.1A.1
ax_a_c1_s1subclause of A.1A.1.1A.1.1
ax_a_c1_n1note of A.1NOTEA.1, NOTE
ax_a_c1_x1example of A.1EXAMPLEA.1, EXAMPLE
ax_a_f1figure in Annex AFigure A.1Figure A.1
ax_a_L1list of A.1List A.1List A.1
ax_a_li1ordered item of the annex lista)a)
ax_bsecond annexAnnex BAnnex B
ax_b_c1clause of Annex BB.1B.1
ax_b_c1_n1note of B.1NOTEB.1, NOTE
bib_1numbered bibliography entry[1][1]
bib_2numbered bibliography entry[2][2]

Engine output: mn112a-tree.json against mn112a-label-style.yaml. Element identifiers are colored by category — clauses in cyan, annexes in amber, figures, tables and lists in magenta, notes, examples, footnotes and bibliography entries in grey.

The two realizations

MN 112 defines two realizations of a profile, and a runtime accepts both: the LutaML instance syntax, carried in .lml files, and a YAML realization, carried under the schema key mn112/1. Equivalent realizations derive the same instance data, the conformance suite stores each profile in both forms, and the loader dispatches on the file extension, so a flavor keeps its profile in whichever form it maintains and the runtime reads the other without change.

// Notes to entry are always numbered, even when a single one, and
// restart within each terminological entry.
instance NoteToEntryLabeller < Labeller {
  id = "note_to_entry_labeller"
  sequence = DecimalNumericSequence
  context = TermEntryContext
  type = "note"
  template = NoteToEntryLabelTemplate
  global_template = NoteToEntryGlobalLabelTemplate
  definition "Labeller for notes to terminological entries (always numbered)"
}
- name: NoteToEntryLabeller
  type: Labeller
  properties:
    id: "note_to_entry_labeller"
    sequence: {ref: DecimalNumericSequence}
    context: {ref: TermEntryContext}
    type: "note"
    template: {ref: NoteToEntryLabelTemplate}
    global_template: {ref: NoteToEntryGlobalLabelTemplate}
    definition: "Labeller for notes to terminological entries (always numbered)"

Source: the LML is verbatim from the flagship fixture; the YAML is the equivalent instance of the mn112a vector.

The LML realization states instances as instance Name < BaseType blocks with attribute assignments, bracketed lists, nested brace maps and free-text definition blocks. The parser accepts the draft spelling with < inheritance and the released LutaML spelling that states inheritance as an isa statement, and a profile written in either form loads and labels identically. The YAML realization is a mapping with exactly the keys schema and instances: the schema value must be mn112/1, each instance carries exactly name, type and properties, references are {ref: Name} mappings, and the loader refuses YAML aliases, custom tags and repeated mapping keys.

Every reference in either realization must resolve: a reference names a declared instance of the profile or one of the fifteen built-in sequences, and a reference to anything else is a load error, not a runtime surprise.

Conformance

A conforming runtime provides the fifteen built-in sequences, accepts both profile realizations, evaluates the labeling algorithm with the counter-scoping and parent-resolution rules stated on this page, raises an error in each of the situations the errors table lists, and resolves catalog values through a Fluent engine. The conformance vectors at kaleidl/kaleidl-testsuite pin document trees to their expected label sets, and every example on this page is drawn from them: the worked ISO/IEC document end to end, the Directives Part 2 labeling categories, terminological entries with notes to entry in English and French, ordered-list ladders four levels deep, profile-declared sequence instances with the four expansion rules, per-annex counter restarts, and the vocabulary battery in its default and French runs.

Every runtime in the Kaleidl fleet vendors the vectors at a pinned reference and re-verifies the snapshot against the testsuite. The model overview carries the same contract as prose, and the playground runs the engine in the browser against a profile you can edit.