Are there plans to remove the restrictions on string arguments? It is hard writing standard XQuery 3.1 when one implementation (BaseX) wants map { 'indent' : 'yes' } and another like Saxon map { 'indent' : true() }
Yes, I guess so. The choices that have been made for the data types of the map arguments are pretty specific (for example, 'version' must be of type xs:string, where 'html-version' must be a decimal). As a result, the correct parsing of the serialization parameters would result in many lines of code that in addition would be incompatible with our existing solution for parsing map arguments of built-in XQuery functions. I’m still hesitant to give it a try.
But I could possibly make parsing more liberal and e.g. convert booleans to strings instead of rejecting them. Something like map { 'indent' : true() } or map { 'html-version' : '5' } could then be successfully parsed.
What's your view of adaptive serialization of map(xs:string,xs:string) and a character map, should the character map be applied to the map's key and value string values?
My general view on the adaptive serialization method is that I would have loved it to become what the name implies (adaptive: best fit for the type that’s to be serialized). Instead, it has more or less become a debugging method, and many details have eventually been left to the implementation. As a consequence, we don’t have real use cases for this method, but if it’s used for debugging, it might be better if character maps were ignored, because they could easily create output that’s difficult to reuse.