n8n-nodes-base
Version:
Base nodes of n8n
63 lines (60 loc) • 2 kB
text/typescript
/**
* XML Node - Version 1
* Discriminator: mode=xmlToJson
*/
/** Converts data from XML to JSON */
export type XmlV1XmlToJsonParams = {
mode: 'xmlToJson';
/**
* Name of the property which contains the XML data to convert
* @default data
*/
dataPropertyName?: string | Expression<string> | PlaceholderValue;
/**
* Options
* @default {}
*/
options?: {
/** Prefix that is used to access the attributes
* @default $
*/
attrkey?: string | Expression<string> | PlaceholderValue;
/** Prefix that is used to access the character content
* @default _
*/
charkey?: string | Expression<string> | PlaceholderValue;
/** Whether to always put child nodes in an array if true; otherwise an array is created only if there is more than one
* @default false
*/
explicitArray?: boolean | Expression<boolean>;
/** Whether to set this if you want to get the root node in the resulting object
* @default true
*/
explicitRoot?: boolean | Expression<boolean>;
/** Whether to ignore all XML attributes and only create text nodes
* @default false
*/
ignoreAttrs?: boolean | Expression<boolean>;
/** Whether to merge attributes and child elements as properties of the parent, instead of keying attributes off a child attribute object. This option is ignored if ignoreAttrs is true.
* @default true
*/
mergeAttrs?: boolean | Expression<boolean>;
/** Whether to trim whitespaces inside text nodes
* @default false
*/
normalize?: boolean | Expression<boolean>;
/** Whether to normalize all tag names to lowercase
* @default false
*/
normalizeTags?: boolean | Expression<boolean>;
/** Whether to trim the whitespace at the beginning and end of text nodes
* @default false
*/
trim?: boolean | Expression<boolean>;
};
};
export type XmlV1XmlToJsonNode = {
type: 'n8n-nodes-base.xml';
version: 1;
config: NodeConfig<XmlV1XmlToJsonParams>;
};