X-definition
<xd:def xmlns:xd="http://www.xdef.org/xdef/4.2" name="Test" root="Distancies"> <xd:json name="Distancies"> { "cities" : [ { %script = "occurs 1..*;", "from": [ "string();", { %script = "occurs 1..*;", "to": "jstring();", "distance": "int();" } ] } ] } </xd:json> </xd:def>
Input data
{ "cities" : [ { "from": ["Brussels", {"to": "London", "distance": 322}, {"to": "Paris", "distance": 265} ] }, { "from": ["London", {"to": "Brussels", "distance": 322}, {"to": "Paris", "distance": 344} ] } ] }
You can edit both
X-definition
and/or
Input data