XML to JSON
Use the XML to JSON action to convert the XML data into JSON format.
Complete the following steps to use the XML to JSON action in your workflow:
1. Click , drag the XML to JSON action under Transform to the canvas, place the pointer on the action, and then click or double-click the action. The XML to JSON window opens.
2. Edit the Label, if needed. By default, the label name is the same as the action name.
3. In the XML Data field, enter the XML data or map an appropriate output of a previous action to provide the XML data that you want to convert to JSON format.
4. In the Attribute Key field, enter the prefix that is used to access the attributes. The default is set to $.
5. In the Ignore Attributes list, select true to ignore all XML attributes and create only text nodes; otherwise, select false. The default is set to true.
6. In the Merge Attributes list, select true to merge attributes and child elements as properties of the parent, instead of keying attributes off a child attribute object; otherwise, select false. The default is set to false.
This option is ignored if you set Ignore Attributes to false.
7. In the Explicit Array list, select true to place child nodes in an array; otherwise, select false. While converting XML data into JSON, an array is created only if there is more than one array. The default is set to false.
8. In the Normalize Tags field, select true to normalize all tag names to lowercase; otherwise, select false. The default is set to true.
9. In the Trim Whitespace list, select true to trim whitespaces inside the text nodes; otherwise, select false. The default is set to false.
10. In the Strip Namespace Prefix list, select true to strip the XML namespace prefix, else select false. The default is set to true.
The XMLNS prefix is not stripped.
11. In the Parse Numbers list, select true to parse integer-like strings as integers and float-like strings as floats; otherwise, select false. The default is set to false.
For example, if you set Parse Numbers to true, the string, '0' is considered as 0 and the string, '15.56' is considered as 15.56.
12. In the Parse Booleans list, select true to parse boolean-like strings as boolean; otherwise, select false.
For example, if you set Parse Booleans to true, the string, 'true' is considered as true and the string, '15.56' is considered as 15.56.
13. In the Strict Parse list, select true to set sax-js to strict mode; otherwise, select false. The default is set to false. It is recommended to set Strict Parse to true because parsing HTML that is not well-formed XML might return an unexpected output.
14. Click Done.
Output schema
Was this helpful?