Element <param>¶
Purpose: Declared contract for one fragment input.
Why: Use it in an included fragment to declare and validate one required or defaulted input.
Example¶
1 | |
Decision guide¶
Business value: Makes a reusable fragment's required inputs and defaults explicit to reviewers and tools.
-
Use when
- An included fragment requires a caller-provided value or exposes a documented default.
-
Choose another approach when
- Supplying the caller-side value or defining an unrelated setup property.
-
Prerequisites
- Place it in the included fragment and give it a stable name.
-
Alternatives
- Use property at the include site to supply the declared parameter. (See:
<property>)
- Use property at the include site to supply the declared parameter. (See:
Complete examples¶
Call one typed descriptor fragment with scoped parameters
Use a param contract and include-local properties when several business products share one model shape but require different bounded values.
| parameterized-fragment/fragments/payment.xml | |
|---|---|
1 2 3 4 5 6 7 8 9 | |
| parameterized-fragment/datamimic.xml | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 | |
Rules and invalid combinations¶
type='enum' requires a non-empty values list.
Attributes: type, values
Why: The fragment contract needs the allowed literal vocabulary to validate include properties.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
A param default cannot contain an expression.
Attributes: default
Why: Defaults are validated at parse time; dynamic values belong on the caller's property script mode.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
A literal default must satisfy the declared param type.
Attributes: default, type, values
Why: The include contract must reject an invalid fallback before the fragment executes.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
I618 โ Parser Include Param Missing
Fragment contract violation for
{contract_table}
{missing_summary}
Why: The included fragment declares required params that were not supplied by the caller.
Resolution: Supply the missing
I619 โ Parser Include Param Invalid Value
Invalid value for param '{param_name}' in
Why: The include caller supplied a literal value that does not satisfy the fragment param contract.
Resolution: Update the
I620 โ Parser Param In Top Level Descriptor
declarations have no effect in top-level descriptors
Why: Fragment param declarations are only consumed when a descriptor is used as an included XML fragment.
Resolution: Move the declarations into a fragment descriptor or remove them from the top-level descriptor.
Allowed parents / Allowed children¶
Allowed parents: else, else-if, if, setup, while
Allowed children:
None
Related concepts and use cases¶
- Dynamic Includes and Fragment Parameters โ Explains URI interpolation, scoped include properties, typed fragment params, runtime caller context, nesting, conditions, and cataloged failures for reusable XML composition.
Attributes¶
Show all 5 attributes
default
Optional literal default injected into the child include scope when omitted by the caller.
optional; string; Default: null.
description
Human-readable explanation surfaced by static schema consumers.
optional; string; Default: null.
name
Fragment param name delivered by
required; string.
type
Param type used for parse-time validation of literal property values.
optional; string; Default: "string"; Values: string, int, enum, path.
values
Whitespace-separated enum values when type='enum'.
optional; string; Default: null.