Writing XML data
When writing XML data, targets create a valid XML document for each record. The target requires the record to have a single root field that contains the rest of the record data.
- Produce a "pretty" output - The target can add indentation to make the XML data human-readable. This adds additional bytes to the record size.
- Validate the schema - The target can validate that the generated XML conforms to the specified schema definition. Records with invalid schemas are handled based on the error handling that is configured for the target.
For a full list of targets that support this data format, see Targets in the "Data Formats by Stage" appendix.
Record structure requirement
When writing XML data, the target expects all record data under a single root field. When necessary, merge record data into a root field earlier in the flow. You can use the Expression Evaluator and Field Remover processors to perform this task.
For example, in the following flow, the Expression Evaluator uses the expression,
${record:value('/')}, to create a root field and copy the entire
record under the root field:

Then, you can use the Field Remover to keep only the root field, which removes all other fields:
