Hi Martin,
> So it seems BaseX is not implementing the finalized spec here.
Exactly. We had implemented the current solution before the map
argument was added as in the official specification. Back then, I
motivated that a map argument would be a reasonable extension to the
XQFO spec. I was proposing the same syntax as for the output
declaration in the prolog (the one that is currently available in
BaseX), and Michael Kay decided to go for a more comprehensive
solution that still needs to be implemented in BaseX.
Hope this helps,
Christian
On Sun, Jun 18, 2017 at 3:31 PM, Martin Honnen wrote:
>
> When I try
>
> serialize("This is a test with a slash / Test.", map { 'method' : 'json',
> 'use-character-maps' : map { '/' : '/'}})
>
> with BaseX 8.6.4 is indicates an error [SEPM0017] Invalid
> 'use-character-maps' value 'map { "/": "/" }'; must be a string.
>
> However, the W3C spec
> https://www.w3.org/TR/xpath-functions-31/#func-serialize suggests the syntax
> is
> use-character-mapsmap(xs:string, xs:string)?
> with "For the use-character-maps option, the value is a map, whose keys are
> the characters to be mapped (as xs:string instances), and whose
> corresponding values are the strings to be substituted for these
> characters.".
>