Hi Joe,
I am happy to hear you are also spreading the word! XQuery has a most clean data model, and BaseX has implemented and extended the language so efficiently and elegantly.
Best, Giuseppe
Universität Leipzig Institute of Computer Science, Digital Humanities Augustusplatz 10 04109 Leipzig Deutschland E-mail: celano@informatik.uni-leipzig.de E-mail: giuseppegacelano@gmail.com Web site 1: http://www.dh.uni-leipzig.de/wo/team/ Web site 2: https://sites.google.com/site/giuseppegacelano/
On 10 Aug 2017, at 16:35, Joe Wicentowski joewiz@gmail.com wrote:
Hi all,
First, I'm just back from DH2017, where Clifford Anderson and I taught two workshops on XQuery using BaseX, along with eXist and Saxon. BaseX performed like a champ. We were able to configure the GUI window to show just the query and results windows—perfect when you're projecting the screen in a large room and want everyone to see. Many thanks for such a great teaching tool! (Our materials are at https://github.com/CliffordAnderson/XQuery4Humanists https://github.com/CliffordAnderson/XQuery4Humanists.)
Back to the topic of this post, though, I noticed a slight difference between BaseX's serialization of arrays when using JSON vs. adaptive methods: with JSON, the array's items are separated by newlines, whereas with adaptive, the items are separated by spaces. This is interesting since the serialization spec notes that the adaptive method delegates the handling of the "indent" parameter to JSON. Some code to reproduce this is below.
I'm curious to know - is there a particular reason for this difference?
Thanks, Joe
serialization-test.xq
xquery version "3.1"; declare namespace output="http://www.w3.org/2010/xslt-xquery-serialization <http://www.w3.org/2010/xslt-xquery-serialization>"; let $array := ["Cheapside","London","Dean Prior","Devon"] for $method in ("json", "adaptive") let $serialization-parameters := <output:serialization-parameters> <output:method>{$method}</output:method> <output:indent>yes</output:indent> </output:serialization-parameters> return fn:serialize($array, $serialization-parameters)
serialization-test_results.txt
[ "Cheapside", "London", "Dean Prior", "Devon" ] ["Cheapside", "London", "Dean Prior", "Devon"]