XML
Parse an XML text column into typed columns, a name/value table, or auto-discovered columns.
What it does
Turns a column of XML text into structured data, three ways. Extract pulls the element and attribute paths you name into their own named, typed columns. Name / value explodes each document into one tidy row per value (path, value, type). Auto-discover turns every child element and attribute into a column for you, reading each type from the data. Elements are matched by local name, so namespaced payloads (service responses, payment instructions, filings) need no prefix bookkeeping.
Inputs and outputs
| Inputs | One. |
| Outputs | One. |
When to use it
- Shred a service response fetched by the REST node (set its response format to Text first)
- Read an XML column out of a database (cast it to text in your SELECT)
- Pull a few known fields out of an XML payload embedded in a CSV or a message field
- Land irregular XML as a name/value table you can pivot
Examples
Extract typed fields
Amt → amount (Decimal), Amt/@Ccy → ccy
Two clean columns; a value that won't convert becomes null.
Explode repeated elements
Ustrd[*] → one row per <Ustrd>
The row's other columns are copied down. Without [*] you get only the first one.
One cell, one document
leave Record element blank
The root element of each cell is the record, the usual shape for a service response.
Many records in one cell
Record element: Body/Order → one row per <Order>
A single name matches that tag anywhere; a path matches its tail.
Tips
- Path syntax: slashes for nested elements (Amt), a leading @ on the last step for an attribute (Amt/@Ccy), [0] for one specific repeat, [*] to explode every repeat into rows.
- Only one [*] per path, and every [*] field must explode the same element; otherwise "one row per occurrence" has no single meaning.
- Extract and Name / value know their columns up front; Auto-discover reads them from the data, so downstream nodes see those columns only after a test run.
- A null cell, a blank cell, malformed XML, or a missing path becomes null and the run keeps going. Switch on "Fail the run" if you'd rather catch bad XML hard.
- Auto-discover buffers the input and reads it twice, so Inference rows is real work saved. An element first seen past that bound won't be a column; set it to 0 to scan everything.
- Reading XML FILES is a different node: use XML Files in the Input section.