Skip to content

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;
}
NameTypeDescription
kind"attribute"An unknown attribute detected.
keystringThe attribute name. Use ctx.element.attrs to access all attributes.
valuestringThe raw attribute value.

Type Literal ​

ts
{
  kind: "child";
  index: number;
  child: SwXmlNode;
}
NameTypeDescription
kind"child"An unknown child element detected.
indexnumberThe zero-based index of the child among its siblings. Use ctx.element.nodes to access all siblings.
childSwXmlNodeThe unknown child element.