Skip to main content
The XML Parse command (Command Type: 1019) parses an XML string into a structured JSON object, preserving the hierarchy and attributes of the original XML.

Overview

The XML Parse command provides functionality for:
  • Converting XML strings into structured JSON objects
  • Preserving XML hierarchy and nested elements
  • Customizing attribute name prefixes in the output

Command Type

Command Type ID: 1019

Parameters

ParameterTypeDescriptionRequired
attributeNamePrefixstringThe prefix to add to attribute names in the output. Defaults to "@"No

Usage Examples

Parse XML with Default Attribute Prefix

{
  "command": "xml-parse",
  "params": {}
}

Parse XML with Custom Attribute Prefix

{
  "command": "xml-parse",
  "params": {
    "attributeNamePrefix": "attr_"
  }
}

Parse XML with No Attribute Prefix

{
  "command": "xml-parse",
  "params": {
    "attributeNamePrefix": ""
  }
}

Output Structure

Given input XML:
<event id="123" status="active">
  <name>Match 1</name>
</event>
With default attributeNamePrefix: "@", the output is:
{
  "event": {
    "@id": "123",
    "@status": "active",
    "name": "Match 1"
  }
}

Common Use Cases

  • SOAP / XML APIs: Parse XML responses from legacy or sports data APIs
  • Feed Parsing: Convert XML-based data feeds into JSON for downstream processing
  • Attribute Extraction: Access XML element attributes as prefixed JSON keys
  • Decode - Decode compressed binary payloads
  • Json Path - Extract fields from the parsed JSON
  • Key Mapping - Remap XML-derived field names