Documentation / @sw-file-lib/xml / xml-schema / DuplicateChildElementCallback
Type Alias: DuplicateChildElementCallback
ts
type DuplicateChildElementCallback = (data: DuplicateChildElementData, ctx: SchemaParseContext) => DuplicateChildElementMode;Defined in: packages/xml/src/xml-schema/parseOptions.ts:98
Callback invoked when multiple child elements are found for a schema field that expects a unique child element.
The callback can inspect the location of the duplicate elements and decide which occurrence should be used, or whether parsing should fail.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | DuplicateChildElementData | The duplicated child tag and matching candidate elements. |
ctx | SchemaParseContext | The location of the element containing the duplicate children. |