Data Converter
Convert between various data formats - Base64, Binary, JSON, XML, YAML, CSV, HTML, and more
Actions49
- Base64 Actions
- Binary Actions
- Encoding Actions
- Format Actions
- HTML Actions
- String Actions
Overview
The node converts data from XML format to JSON format. It takes XML input as a string and parses it into a JSON object representation. This operation is useful when you need to work with XML data in workflows that primarily handle JSON, enabling easier manipulation, filtering, or integration with other systems expecting JSON.
Common scenarios:
- Parsing XML API responses into JSON for further processing.
- Converting XML configuration files or data feeds into JSON objects.
- Integrating legacy systems outputting XML with modern JSON-based services.
Example:
Input XML:
<person><name>John</name><age>30</age></person>
Output JSON:
{
"person": {
"name": "John",
"age": "30"
}
}
Properties
| Name | Meaning |
|---|---|
| Input Data | The XML data string to convert to JSON. |
| Binary Property Name | (Optional) Name for the output binary property if outputting binary data instead of JSON. |
Output
The node outputs a JSON object representing the parsed XML structure under the json field. The JSON mirrors the XML hierarchy and elements as nested objects and properties.
If configured to output binary data (not typical for this operation), the binary output would contain the converted data in a binary form, named by the specified binary property name.
Dependencies
- No external services or API keys are required.
- Uses internal utility functions for XML parsing bundled within the node's dependencies.
- No special environment variables or n8n configurations needed.
Troubleshooting
- Malformed XML input: If the XML string is not well-formed, the node will throw an error during parsing. Ensure the XML input is valid.
- Empty input: Providing empty or missing XML data will result in errors or empty output.
- Large XML documents: Very large XML inputs might cause performance issues or timeouts depending on system resources.
- Error messages: Typical errors include parsing exceptions indicating invalid XML syntax. To resolve, validate and correct the XML input before passing it to the node.