ConvertXmlToJson
Converts XML string to JSON format
- Type
- javascript
- Pack
- CommonScripts
Source
var xmlJson = x2j(args.xml);
try {
xmlJson = JSON.parse(xmlJson);
} catch(err) {}
if (args.contextKey && args.contextKey.length > 0) {
setContext(args.contextKey,xmlJson);
}
if (args.verbose && args.verbose.length > 0 && args.verbose == 'True'){
return xmlJson;
}
README
Converts a XML string to JSON format.
Script Data
| Name | Description |
|---|---|
| Script Type | javascript |
| Tags | Utility |
Inputs
| Argument Name | Description |
|---|---|
| xml | The valid XML to convert to JSON format. |
| contextKey | The context key to push the JSON result to. |
| verbose | Prints the JSON result to War Room. |
Outputs
There are no outputs for this script.