X-definition
If you have a collection with more X-definitions enter the name of X-definition with root JSON data:
<xd:def xmlns:xd = "http://www.xdef.org/xdef/4.2" name = "Example" root = "test"> <xd:json name = "test"> [ { "Date": "date(); finally outln('City distances. Measurement taken on: ' + getText());"}, { "%script": "occurs 1..*;", "%anyName": [ "%script: occurs 1..*; init printf('Distance from %s to%n', getXonKey());", { "%script": "var String to, dist; occurs 1..*; finally printf(' %s: %s (km)%n', to, dist);", "to": "required string(); onTrue to = getText();" "distance": "required int(); onTrue dist = getText();", } ] } ] </xd:json> </xd:def>
Input data
(can be YAML, JSON, XON or XML format)
[ { "Date": "2020-02-22"}, { "Brussels": [ {"to": "London", "distance": 322}, {"to": "Paris", "distance": 265} ] }, { "London": [ {"to": "Brussels", "distance": 322}, {"to": "Paris", "distance": 344}, {"to": "Amsterdam", "distance": 358} ] } ]
You can edit
X-definition
or
Input
window