I've seen statements that JSONiq query language also supports processing XM, but the only example I found is in the JSONiq Wikipedia article. It looks like XML processing is only possible with the "JSONiq extension to XQuery" but this is not the same as JSONiq, isn't it? The JSONiq specification does not include XML syntax, so it should be forbidden?
1
There are 1 best solutions below
Related Questions in XML
- Postgres && statement Error in Mybatis Mapper?
- Sorting items after building an XML feed?
- C# XML ModelBinding - ASP.NET Core 8 Web API - required field not found
- How can I create an automatic table of contents in docx without the text being bold?
- Odoo 16 Make Fields Readonly Using XPath
- Using similar tags for different objects in XML
- Android Studio problem like gradle sync project failed and plugin error, version 2023.2.1 Iguana
- error: cannot find symbol View root = inflater.inflate(R.layout.toolbar, parent, false);
- Android camera application restriction to 12 mp
- Azure Data Factory Copy Activity Only Importing First Row of XML file
- I am not able to remove space below the navigation view icon in android studio. What;s wrong with code?
- Field can be converted to a local variable ,convert field to local variable in onCreate method
- Deserialize XML with optional different name
- Retrieve tags from xml using python
- Getting attribute from xml and printing it error
Related Questions in JSONIQ
- Remove duplicates in an object in JSONiq
- Storing an object with key value pairs in a variable in JSONiq
- How to write the program in JSONiq if the table is empty?
- How do I fix the Jsoniq static error: invalid expression: syntax error, unexpected "every"?
- Performing joins in JSONiq (e.g., with the filter syntax)
- JSON not being able to compile due to : Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'
- First Order Logic translation
- Are the JSONiq documentation code snippets valid?
- JSONiq - how do you convert an array to a sequence?
- advanced JSON query language
- Array and object lookups in JSONiq
- Fetching JSON data with JSONiq
- Does JSONiq support processing XML?
- How to use JSONiq for JSON
- How to run JSONiq from JSON with try.zorba.io
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The core JSONiq language supports only JSON, in the same the core XQuery language supports only XML. However, there are many people who want to query both XML and JSON in the same program, for example to convert one to the other. This is why there are extensions (both ways). Rather than forbidden, I would say that they are optional (and actually encouraged).
If the data is a mix of JSON and XML, then you can use either the "JSONiq extension to XQuery" or the "XQuery extension to JSONiq." The differences are minor and revolve around convenience. Feature-wise, both are equivalent.
The exact differences are comprehensively documented here
A complete grammar with JSONiq, the XQuery extension and even updates and scripting is available here.
If there is a lot of JSON and a bit of XML, then "the "XQuery extension to JSONiq" is more adequate: you can query JSON with dots and escaping in strings is done with backslashes, and literals like
null,trueandfalseare recognized, but any XPath name queries on XML Names must be prefixed by ./ (./fooinstead of justfoo), etc.If there is a lot of XML and a bit of JSON, the "JSONiq extension to XQuery" is more adequate. It is the opposite: the exact, W3C-compliant XPath syntax is supported and string escaping with ampersands, but for example booleans and nulls must be written as
true(),false(),null()to not interfere with XPath.The Zorba engine supports both of the variants, and you can switch using
xquery version "3.0"orjsoniq version "1.0"in the header of the query, with no further configuration: if you use JSONiq, the XQuery extension is always available as well, and if you use XQuery, the JSONiq extension is always available.If no header is present, then the extension
.xqor.jqis used to infer the language used.Whether or not a JSONiq processor supports the XQuery extension is a decision of the software provider. In general, we encourage implementors of a JSONiq engine to support the XQuery extension if they have the resources. Providers who want to keep a very lightweight engine will stick to core JSONiq.
The other way round, extending an existing XQuery engine with the JSONiq extension is very easy: when we did so in Zorba when we started supporting JSON, it only took us a few days because the JSON data model is so simple. There is a talk by Jonathan Robie sharing experience on this topic on Youtube.