The name of the name/value pair is mapped to an element node. The name of the element node is equal to the name of the name/value pair.
The value of the name/value pair is mapped to a text node as described in
clause 9.3.3.
The text node coming from the value of a mapped name/value pair is the child of the element node coming from the name of the mapped name/value pair. Vice versa, the element node coming from the name of the mapped name/value pair is the parent of the text node coming from the value of the mapped name/value pair.
Examples:
The data type of the scalar value is number.
The data type of the scalar value is string.
"a": "string"
|
<a>string</a>
|
The data type of the scalar value is the literal name null.
The data type of the scalar value is the literal name true.
The data type of the scalar value is the literal name false.
The name of the name/value pair is mapped to an element node. The name of the element node is equal to the name of the name/value pair.
The value of the name/value pair consists of an unordered list of name/value pairs. Each name of these name/value pairs is mapped to an element node. No order can be assumed for these element nodes.
The element nodes coming from the value of the mapped name/value pair are children of the element node coming from the name of the mapped name/value pair. Vice versa, the element node coming from the name of the mapped name/value pair is the parent of the element nodes coming from the value.
Example:
"a": {
"b": 1,
"c": 2
}
|
<a>
<b>1</b>
<c>2</c>
</a>
|
or
"a": {
"b": 1,
"c": 2
}
|
<a>
<c>2</c>
<b>1</b>
</a>
|
"a": {
"b": 1,
"c": {
"d": 2,
"e": 3
}
}
|
<a>
<b>1</b>
<c>
<d>2</d>
<e>3</e>
</c>
</a>
|
The name of the name/value pair is mapped to a specific number of element nodes. The number of element nodes is equal to the number of array items. The names of these element nodes are all identical and equal to the name of the name/value pair.
The order of element nodes is the same as the order of the array items in the corresponding JSON.
The element nodes coming from the value of the mapped name/value pair are children of the element node coming from the name of the mapped name/value pair. Vice versa, the element node coming from the name of the name/value pair is the parent of the element nodes coming from the array items of the JSON array.
Example:
"a": [
1,
2,
3
]
|
<a>1</a>
<a>2</a>
<a>3</a>
|
"a": [
{"b": 1,
"c": 2
},
{"b": 3,
"c": 4
},
{"b": 5,
"c": 6
},
]
|
<a>
<b>1</b>
<c>2</c>
</a>
<a>
<b>3</b>
<c>4</c>
</a>
<a>
<b>5</b>
<c>6</c>
</a>
|
A JSON document is mapped to root nodes, element nodes and text nodes. Attribute nodes, namespace nodes, processing instruction nodes and comment nodes have no equivalent in JSON.
The concept of document order is applicable only for element nodes coming from JSON arrays.
The concept of variables is not used in Jex.
The root node in the XPath 1.0 data model may have only one element node as child (the document element). This restriction is relaxed in Jex. The root node may have any number of element nodes as children.
Example:
{
"a": 1,
"b": 2,
"c": 3
}
|
<a>1</a>
<b>2</b>
<c>3</c>
|