Skip to main content

XML Agent

Parse and transform XML data into a structured format for analysis.

Updated today

Overview

The XML agent enables the ingestion and transformation of XML content from a specified input field. It supports converting XML to JSON, selecting nodes for row-level processing, and extracting elements into structured columns. Configuration options such as root unwrapping and namespace handling provide flexibility for various XML formats.

Configuration Options

Input Field

Specifies the dataset field containing the raw XML data.
The XML must be well-formed; invalid XML will cause parsing to fail.


Convert to JSON

Transforms the entire XML document into a JSON object.

  • Process XML Namespace: Toggles namespace parsing. Enable this if the XML contains prefixed elements or attributes.Suitable for converting hierarchical XML structures into a more accessible JSON format for further analysis.

Select and Explode

Action: Applies an XPath expression to extract specific elements or nodes and explodes the result into individual rows.
​Options:

  • XPath Expression: Identifies the XML elements or node sets to explode (e.g., //items/item).

  • Unwrap Root: If enabled, removes the outermost root element before processing the XPath.Ideal for extracting repeated structures such as arrays or nested items that should be represented as separate records.

Extract to Columns

Extracts specific values from XML using XPath and maps them to columns in a flat table.

  • XPath Expressions: Provide paths for each field to extract.

  • Unwrap Root: Removes the root wrapper to simplify path targeting.Best suited for XML with a known schema where each element or attribute maps to a distinct column.

Additional Notes

  • XPath expressions should accurately reflect the structure of the XML data to ensure correct extraction.

  • Use Unwrap Root when the root element is not needed or adds unnecessary nesting.

  • Enable Process XML Namespace when de

  • aling with XML documents that include namespace declarations or prefixes.

Did this answer your question?