Skip to main content

@elizaos/core v1.0.0-beta.51 / parseKeyValueXml

Function: parseKeyValueXml()

parseKeyValueXml(text): Record<string, any>

Parses key-value pairs from a simple XML structure within a given text. It looks for an XML block (e.g., ...) and extracts text content from direct child elements (e.g., value).

Note: This uses regex and is suitable for simple, predictable XML structures. For complex XML, a proper parsing library is recommended.

Parameters​

• text: string

The input text containing the XML structure.

Returns​

Record<string, any>

An object with key-value pairs extracted from the XML, or null if parsing fails.

Defined in​

packages/core/src/utils.ts:410