Overview
This node parses XML data into JSON format. It is useful when you have XML strings either in the entire item JSON or within a specific JSON field and want to convert that XML into a structured JSON object for further processing. For example, it can be used to parse XML responses from APIs or XML data stored in JSON fields, enabling easier data manipulation and integration in workflows.
Use Case Examples
- Parsing an XML string contained in a specific JSON field named 'xml' and outputting the parsed JSON under 'parsedData'.
- Parsing XML data from the entire item JSON when the XML string is not confined to a single field.
- Extracting a specific nested part of the parsed XML using a root path like 'Envelope.Body.QueryLimitResponse.QueryLimitResult.Value'.
Properties
| Name | Meaning |
|---|---|
| Data Source | Specifies whether to parse XML from the entire item JSON or from a specific JSON field. |
| XML Field Name | The name of the JSON field containing the XML string to parse. Only applicable if 'Data Source' is set to 'Belirli Field'. |
| Output Field | The JSON field name where the parsed XML data will be stored. |
| Root Path | The path within the parsed XML JSON from which to start extracting data. Useful for focusing on a specific nested part of the XML. |
Output
JSON
parsedData- The parsed XML data converted into JSON format, stored under the specified output field.
Dependencies
- fast-xml-parser library for XML parsing
Troubleshooting
- If the XML string is not found in the specified field or item, the node throws an error indicating the missing XML string. Ensure the XML string exists in the specified location.
- If the XML string is malformed or cannot be parsed, an error is thrown with details about the parsing failure. Validate the XML format before processing.
- If the specified root path does not exist in the parsed JSON, an error is thrown indicating the missing path. Verify the root path string matches the structure of the parsed XML JSON.
- If the parsed data at the root path is empty or null, an error is thrown indicating empty parsed data. Check the root path and XML content.