Creating JSON Modules

JSON Modules are created by using Tosca XScan. For further information please see also chapter "Creating an XSD schema and Modules". The following table contains the business-based control types along with their icons.

Business-based control types

Icon

Business-based control type

JSON array

JSON object

JSON value

  • The XModule is named according to the scanned file.

  • Elements in JSON objects are scanned as unsorted lists, and they are identified by their name.

    The order of elements within JSON objects is possibly not the same as in the scanned files. Since JSON objects are processed as lists of unsorted pairs, this has no effect on the behavior.

  • Elements in JSON arrays are identified by their position. These elements are named item#<position>. For <position> the number of their position is entered.

  • The DataType of JSON values is set according to the scanned values and copied to the Module (String, Numeric, etc).

Example

{
    "bookstore": {
        "book": [{
            "category": "cooking",
            "title": {
                "lang": "en",
                "text": "Everyday Italian"
            },
            "author": "Giada De Laurentiis",
            "year": "2005",
            "price": "30.00"
        },
        {
            "category": "children",
            "title": {
                "lang": "en",
                "text": "Harry Potter"
            },
            "author": "J K. Rowling",
            "year": "2005",
            "price": "29.99"
        }]
    }
}

After the example given above is scanned using Tosca XScan, the following XModule is created:

JSON Module - Example