Product SiteDocumentation Site

Chapter 10. JSON Serialization

10.1. New serialization parameters
10.2. Changes to sequence normalization
10.3. The JSON output method
10.3.1. Serialization of a sequence of items
10.3.2. Serialization of individual JSON values
10.3.3. Influence of other serialization parameters upon the JSON output method
10.4. The JSON-XML-hybrid output method
10.5. Changes to ther other output methods
JSONiq defines two new output methods: "JSON" and "JSON-XML-hybrid". The JSON output method outputs guaranteed JSON (application/json) with the small exception that it may also output a sequence of objects and arrays (as seems to be standard practice, for example, in REST APIs). The JSON-XML-hybrid method allows serializing mixed sequences of JSON items and XML nodes for convenience. The JSON-XML-hybrid method is the default output method.

10.1. New serialization parameters

One new serialization parameter is introduced:
  • jsoniq-multiple-top-level-items (one of: "yes", "no"):
    Specifies if multiple items are allowed. Default is "yes".