Am 27.02.2020 um 07:49 schrieb Johannes Bauer:
I'm trying to deactivate the escaping of characters for JSON
serialization.

It does not work with this:

let $json := <map xmlns="http://www.w3.org/2005/xpath-functions";>
    <string key="url">http://some.url/path/to/somewhere</string></map>
return json:serialize($json, map {'format' : 'basic', 'escape': 'no'})

Output:
{
  "url":"http:\/\/some.url\/path\/to\/somewhere"
}

Does

serialize(<map xmlns="http://www.w3.org/2005/xpath-functions";>
    <string key="url">http://some.url/path/to/somewhere</string></map>,
  map { 'method' : 'json', 'use-character-maps' : map { '/' : '/'}})

do what you want?

Reply via email to