Server protocol bug?
Hi,
While testing for basex-stream i encountered a weird behavior in the OPTIONS query command.
After creating the query
declare option output:method "json";
declare option output:json "lax";
<json type="object"/>the response of OPTIONS was:
json=lax=true,method=json
Which seems wrong.
I event tried setting cdata-section-elements to "pre, code" and the response had a double comma ("cdata-section-elements=pre,,code,method=xml")
Is this a bug or is there some deterministic method of parsing the response?
Thanks, Alex
The behavior is correct indeed. But I agree it is surprising, and it has not properly been documented so far:
Quoted text · alxarch · 1 line
> declare option output:json "lax";
This is a shortcut for "lax=true". Thus, the boolean value will always be appended in the string representation, no matter if it has been specified in the original serialization option.
Quoted text · alxarch · 3 lines
> I event tried setting cdata-section-elements to "pre, code" > and the response had a double comma > ("cdata-section-elements=pre,,code,method=xml")
Single commas will be duplicated, such that they can be distinguished from option separators. This was only documented for the BINDINGS option, but not it's also documented for serialization parameters [1] and the server protocol.
Thanks, Christian
I missed the obvious part of option 'suboptions'
I fixed the parsing in basex-stream and now query.options() returns an object in v0.1.2.
Written for BaseX 8.1. BaseX may have changed since: please check the current documentation.