Closed mspiegel closed 7 years ago
Hi Michael,
Zorba supports two parsers: JSONiq (more pleasant for JSON data), and XQuery (more pleasant for XML data). The default parser is XQuery. The differences are documented on this page.
In order to activate the JSONiq parser, you need to use the JSONiq header (jsoniq version "1.0";)before your query:
zorba -q 'jsoniq version "1.0"; {"foo":"bar"}.foo'
For completeness: object lookup is also possible with the XQuery parser, however the syntax is that of a function call:
zorba -q '{"foo":"bar"}("foo")'
Oops now I see this documented on the link provided and I also see it on https://github.com/ghislainfourny/jsoniq-tutorial. Thank you!