Skip to content

XML

The XML Operator enables working with XML (eXtensible Markup Language) files. It provides functionality for converting data to XML format and parsing XML content into structured data.

  • Converting object data to XML format
  • Parsing XML files into structured data
  • Integrating with systems that use XML for data exchange
  • Processing configuration files in XML format
  • Working with XML-based APIs
  • Data transformation between XML and other formats
  • Generating XML reports or documents

Converts an input object to an XML file. Uses object fields/elements as XML elements.

  • value (Object): The data to convert to XML format
  • encoding (string): The character encoding to use for the XML file

Returns a FileDto object containing information about the created XML file, including:

  • id (string): The unique identifier of the file
  • name (string): The file name (default is “data.xml”)
  • contentType (string): The content type (“application/xml”)
  • size (long): The file size in bytes
  • organizationId (string): The organization ID associated with the file
{
"value": {
"customer": {
"id": "12345",
"name": "John Doe",
"email": "[email protected]",
"address": {
"street": "123 Main St",
"city": "Anytown",
"zipCode": "12345"
}
},
"items": [
{"id": "item1", "name": "Product 1", "price": 19.99},
{"id": "item2", "name": "Product 2", "price": 29.99}
]
},
"encoding": "UTF-8"
}

Reads a provided XML file and converts it to structured data.

  • file (FileDto): The XML file to read
  • encoding (string, optional): The character encoding of the file

Returns a Map representing the XML data structure, with element names as keys and their content as values. Nested elements are represented as nested Maps.

{
"file": {
"id": "file-123",
"organizationId": "org-456"
}
}
  • The operator uses Jackson’s XmlMapper for XML parsing and generation
  • XML elements are automatically wrapped in a root element if needed
  • Complex objects are converted to XML elements with nested structure
  • The XML parsing preserves the hierarchical structure of the original XML