XML Methodology
The following examples show how different data types are represented in XML. They mirror how the data structures are represented in JSON.
Simple types
The representation of loose (not a direct bean property value) simple types are shown below:
| Data type | JSON example | XML |
|---|---|---|
| string | | |
| boolean | | |
| integer | | |
| float | | |
| null | | |
Maps
Loose maps and beans use the element <object> for encapsulation.
_type attributes are added to bean properties or map entries if the type cannot be inferred through reflection (e.g.
an Object or superclass/interface value type).
| Data type | JSON example | XML |
|---|---|---|
| Map | | |
| Map | | |
| Map | | |
Arrays
Loose collections and arrays use the element <array> for encapsulation.
| Data type | JSON example | XML |
|---|---|---|
| String[] | | |
| Number[] | | |
| Object[] | | |
| String[][] | | |
| int[] | | |
| boolean[] | | |
| List<String> | | |
| List<Number> | | |
| List<Object> | | |
Beans
| Data type | JSON example | XML |
|---|---|---|
| | |
Beans with Map properties
| Data type | JSON example | XML |
|---|---|---|
| | |
Share feedback or follow-up questions for this page directly through GitHub.