Re: [basex-talk] Differences in serialization of arrays with JSON vs. adaptive methods

2017-08-10 Thread Christian Grün
Hi there, To begin with: I forgot to mention that you can change the serialization method by launching the command "set serializer method=adaptive" in the command input text field on top of the BaseX window. I agree this is not very comfortable, so I have now added a new interaction component

Re: [basex-talk] Shouldn't CHOP = false make xml:space="preserve" the default behavior?

2017-08-10 Thread Christian Grün
I agree that it might be reasonable to introduce different defaults for WebDAV communication. Problems could arise if documents are opened with WebDAV that have been stored via REST or another API… But we could give it a try. On Thu, Aug 10, 2017 at 11:28 PM, Andy Bunce

Re: [basex-talk] Differences in serialization of arrays with JSON vs. adaptive methods

2017-08-10 Thread Christian Grün
Hi Joe, > Have you considered adding a preference or toggle for selecting the default > serialization method used in the GUI's results? Sounds like an enticing idea! Something similar is embedded in our Database Export dialog (see menü items 'Database', 'Export…'). I haven’t touched it for

Re: [basex-talk] Differences in serialization of arrays with JSON vs. adaptive methods

2017-08-10 Thread Joe Wicentowski
Hi Christian, I actually quite like the adaptive serialization method and have made it the default in eXide. From my perspective in teaching XQuery, showing an xs:string item in quotes (and integers sans quotes) helps reinforce the concept of data types. It feels to me like a datatype-sensitive

Re: [basex-talk] Shouldn't CHOP = false make xml:space="preserve" the default behavior?

2017-08-10 Thread Andy Bunce
It seems globally setting `indent=no` gets applied to WebDAV (and everywhere else where serialization is not explicit specified). This would be my preference for WebDAV, as it means documents can be round-tripped without any changes being introduced. The only side effect from this setting I have

Re: [basex-talk] Differences in serialization of arrays with JSON vs. adaptive methods

2017-08-10 Thread Christian Grün
Hi Joe, Thanks for the link. So I noticed that you were quoting exactly the same phrase of the spec as I did. ;) I just checked what Saxon does: It seems to ignore the value of the indent parameter when serializing arrays with the adaptive method. So I guess that every implementation of XQuery

Re: [basex-talk] Shouldn't CHOP = false make xml:space="preserve" the default behavior?

2017-08-10 Thread Christian Grün
Hi Andy, > Can the WebDAV serialization be set independently of the default, in > web.xml? The defaults for whitespace chopping and serialization can only be assigned globally for all features of BaseX. Did you try to set both 'org.basex.chop' and 'org.basex.serializer' in web.xml / does it

Re: [basex-talk] Differences in serialization of arrays with JSON vs. adaptive methods

2017-08-10 Thread Christian Grün
Dear Joe, Thanks for the kind feedback. I am glad to hear BaseX was useful in your DH 2017 workshops. > the serialization spec notes that the adaptive method delegates the handling > of the "indent" parameter to JSON. Could you possibly point me to this rule in the spec? I remember there was a

Re: [basex-talk] Shouldn't CHOP = false make xml:space="preserve" the default behavior?

2017-08-10 Thread Andy Bunce
>But it may definitely cause undesirable output if a document contains no superfluous whitespaces, One situation where the default serialization indentation can be problematic is WebDAV. Can the WebDAV serialization be set independently of the default, in web.xml? /Andy On 7 August 2017 at

Re: [basex-talk] Differences in serialization of arrays with JSON vs. adaptive methods

2017-08-10 Thread Giuseppe Celano
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

[basex-talk] Differences in serialization of arrays with JSON vs. adaptive methods

2017-08-10 Thread Joe Wicentowski
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

Re: [basex-talk] Single quotes with json::parse

2017-08-10 Thread Thomas Daly
Hello, Yes, I did escape all of them but got the same error. I have tried Christian's solution which solves the problem, and good to know about too. Many thanks, Thomas -Original Message- From: basex-talk-boun...@mailman.uni-konstanz.de

Re: [basex-talk] Single quotes with json::parse

2017-08-10 Thread Sebastian Albert
Just to make sure: Have you also escaped Merchant Taylors' School at the same time? I've successfully tried to escape the apostrophe. On 10.08.2017 14:41, Thomas Daly wrote: > Regarding the JSON module json::parse function, how do you cope with > single quotes within the JSON data? > > > >

Re: [basex-talk] Single quotes with json::parse

2017-08-10 Thread Christian Grün
Hi Thomas, This problem is a general one when working with quotes; see: 'It is called "St. John's College"!' One solution is to go with the XQuery 3.1 string constructor [1] ``[It is called "St. John's College"!]`` Cheers, Christian [1]

[basex-talk] Single quotes with json::parse

2017-08-10 Thread Thomas Daly
Regarding the JSON module json::parse function, how do you cope with single quotes within the JSON data? I have tried escaping them with a backslash, but to no avail. In this example I think it's the single quote in "St. John's College" that is causing the problem: XQUERY let $database :=