Documentation / @sw-file-lib/xml / xml-schema / UnknownFieldData
Type Alias: UnknownFieldData
ts
type UnknownFieldData =
| {
kind: "attribute";
key: string;
value: string;
}
| {
kind: "child";
index: number;
child: SwXmlNode;
};Defined in: packages/xml/src/xml-schema/parseOptions.ts:43
The data passed to the UnknownFieldCallback.
Union Members
Type Literal
ts
{
kind: "attribute";
key: string;
value: string;
}| Name | Type | Description |
|---|---|---|
kind | "attribute" | An unknown attribute detected. |
key | string | The attribute name. Use ctx.element.attrs to access all attributes. |
value | string | The raw attribute value. |
Type Literal
ts
{
kind: "child";
index: number;
child: SwXmlNode;
}| Name | Type | Description |
|---|---|---|
kind | "child" | An unknown child element detected. |
index | number | The zero-based index of the child among its siblings. Use ctx.element.nodes to access all siblings. |
child | SwXmlNode | The unknown child element. |