Docs Cloud Redpanda Connect Components Processors xml xml Available in: Cloud, Self-Managed Parses messages as an XML document, performs a mutation on the data, and then overwrites the previous contents with the new value. # Config fields, showing default values label: "" xml: operator: "" cast: false Operators to_json Converts an XML document into a JSON structure, where elements appear as keys of an object according to the following rules: If an element contains attributes they are parsed by prefixing a hyphen, -, to the attribute label. If the element is a simple element and has attributes, the element value is given the key #text. XML comments, directives, and process instructions are ignored. When elements are repeated the resulting JSON value is an array. For example, given the following XML: <root> <title>This is a title</title> <description tone="boring">This is a description</description> <elements id="1">foo1</elements> <elements id="2">foo2</elements> <elements>foo3</elements> </root> The resulting JSON structure would look like this: { "root":{ "title":"This is a title", "description":{ "#text":"This is a description", "-tone":"boring" }, "elements":[ {"#text":"foo1","-id":"1"}, {"#text":"foo2","-id":"2"}, "foo3" ] } } With cast set to true, the resulting JSON structure would look like this: { "root":{ "title":"This is a title", "description":{ "#text":"This is a description", "-tone":"boring" }, "elements":[ {"#text":"foo1","-id":1}, {"#text":"foo2","-id":2}, "foo3" ] } } Fields operator An XML operation to apply to messages. Type: string Default: "" Options: to_json . cast Whether to try to cast values that are numbers and booleans to the right type. Default: all values are strings. Type: bool Default: false Back to top × Simple online edits For simple changes, such as fixing a typo, you can edit the content directly on GitHub. Edit on GitHub Or, open an issue to let us know about something that you want us to change. Open an issue Contribution guide For extensive content updates, or if you prefer to work locally, read our contribution guide . Was this helpful? thumb_up thumb_down group Ask in the community mail Share your feedback group_add Make a contribution workflow Caches