---
schema_version: "1"
id: 7526a7e79468a1ae6978b30cddd79a4e54293d3aeb6dabb586538a261b270675
title: XML and JSON in Omnistudio Data Mappers
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_xml_in_dataraptors_46723.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_xml_in_dataraptors_46723.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 576bd2cb4b16b777c1c70da0c49a3aaee9f18dfb12bf84741297c9918a8b8d18
description: In addition to JSON, Data Mappers can have XML input and output. The XML format in Data Mappers is an unordered key-value, JSON-like structure.
products:
  - Omnistudio
release: "264"
---
# XML and JSON in Omnistudio Data Mappers

In addition to JSON, Data Mappers can have XML input and output. The XML format in Data Mappers is an unordered key-value, JSON-like structure.

To specify the order in which the elements of the XML output are serialized, populate the **Expected XML Output** pane with an XML structure that is composed in the desired order.

This example compares equivalent structures in JSON and XML.

JSON

```json
{
  "Root": {
    "#text": "rootValue",
    "@attribute1": "attVal1",
    "#ns": "http://namespace1",
    "#ns#a": "http://namespace2",
    "Child": [{
        "@attribute2": "attval2"
      },
      {
        "#text": "childValue"
      }
    ]
  }
}
```

XML

```xml
<Root attribute1="attVal1" xmlns="http://namespace1" xmlns:a="http://namespace2">
   rootValue
   <Child attribute2="attval2"></Child>
   <Child>childValue</Child>
</Root>
```

Data Mappers that transform XML to JSON by using these conventions to handle the differences between the formats.

Values in an input XML node are translated to output JSON with the key `#text`.

XML:

```xml
<Root>rootValue</Root>
                    
```

JSON:

```json
{
  "Root": {
    "#text": "rootValue"
  }
}
```

Values in an input XML node are translated to output JSON with a key that is preceded by an at sign (`@`).

XML:

```xml
<Root attribute1="attVal1"></Root>
```

JSON:

```json
{
  "Root": {
   "@attribute1": "attVal1"
  }
}
```

Namespaces in an input XML node are prepended with `#ns` in the output JSON.

XML:

```xml
<Root xmlns="http://namespace1" xmlns:a="http://namespace2">
</Root>
```

JSON:

```json
{
  "Root": {
"#ns":"http://namespace1",
"#ns#a":"http://namespace2,
  }
}
```

Colons, which are reserved characters in Data Mapper mappings, are replaced by `#`.

XML:

```xml
<Root:Data>data</Root:Data>
```

JSON:

```json
{
  "Root#Data": {
    "#text":"data",
  }
}
```