Skip to content

Element <value>

Purpose: Declare one scalar constant inside a literal array.

Why: Use it inside a literal array to declare one scalar value in stable document order.

Example

1
<value constant="enabled"/>

Decision guide

Business value: Preserves a small literal vocabulary in exact document order inside an array.

  • Use when

    • An array contains explicit scalar constants rather than generated entries.
  • Choose another approach when

    • Values are generated dynamically or entries need their own fields and conditions.
  • Prerequisites

    • Place it inside a literal array and provide the constant value.
  • Alternatives

    • Use key for a generated scalar product field. (See: <key>)
    • Use item for a structured or conditional list entry. (See: <item>)

Complete examples

Declare literal values in stable order

Use value children when an array must preserve exact literal content instead of generating values.

literal-array/datamimic.xml
1
2
3
4
5
6
7
8
<setup>
    <generate name="feature_flags" count="2" target="LogExporter">
        <array name="flags" type="literal">
            <value constant="enabled"/>
            <value constant="beta"/>
        </array>
    </generate>
</setup>

Rules and invalid combinations

No additional element-specific rules. Required attributes, types, and supported values are shown below.

Allowed parents / Allowed children

Allowed parents: array, else, else-if, if, while

Allowed children:

None

  • Structured Data and Rule Pipelines — Shows how composite output shapes and the ordered source-filter, mapping, and target-filter pipeline work together without hiding phase boundaries.

Attributes

Show all 1 attributes

constant

Literal value preserved exactly in literal arrays.

required; string.