XML and JSON

SIF supports XML and JSON payloads in its APIs. There are mappings defined between XML and JSON. Since SIF Infrastructure version 3.3 there are two flavours of JSON supported. Each flavour is detailed below. The Open API definitions of the locale’s data model APIs and the infrastructure APIs provide examples for XML and both flavours of JSON.

XML

XML has been part of SIF since SIF was introduced in the late 1990s and continuous to be a core format for any SIF API. All data models in SIF have an associated XSD that defines the data structure. These XSDs are published on the A4L site and are specific for each locale’s data model. Please refer to SIF Data Model Specification page to find applicable URLs where the XSDs can be found and downloaded.

JSON

JSON has been introduced to SIF in SIF Infrastructure version 3.1. It was always the intention to have a loss-less and ambiguous free mapping between XML and JSON. SIF 3.1 decided to use the Goessner mapping/notation as it provides such a loss-less mapping. However there are a few “not so nice” parts in the mapping that caused some controversy with a pure JSON approach. An example is that XML attributes are mapped with a prefix of an '@' character. To allow for a more pure JSON notation, SIF additionally adopted the PESC JSON mapping since SIF 3.3. A SIF implementation can choose which notation it wants to use/support however a specific implementation may choose to only support one of the notations and not both.

Should mention the “Schema Negotiation” proposal here….

Goessner

The Goessner notation for XML to JSON mapping and vice versa has been adopted by SIF in version 3.1. It provides a generic and loss-less mapping between the two formats. The Goessner mapping rules do not require any XML schema knowledge or awareness. It can be performed by simply parsing the XML and applying the rules to produce the JSON and reverse. The mapping rules can be found on the XML.com page in the “Converting Between XML and JSON” section.

PESC

SIF 3.3 adopted an additional XM/JSON mapping. These mappings have been developed by the Postsecondary Electronic Standards Council (PESC) with support of the A4L community and are referred to as PESC JSON. This XML/JSON mapping is a “schema-aware” mapping meaning that the XML Schema is taken into account when a translation between the two formats is performed. That approach resolves a couple of inconsistencies and drawbacks the Goessner notation encountered. The mapping rules can be found here.