I investigated this issue a little more. The problem seems to be in the

zorba -q tmp.xq -f --optimization-level O0

returns the correct result.

<?xml version="1.0" encoding="UTF-8"?>


zorba -q tmp.xq -f --optimization-level O1

raises the error.

Tracing this further, it seems as if the json:parse function returns the
options element created in json:serialize (if the optimizer is used). It
clearly returns the correct value if the query is used without

I'm assigning this to Markos to help looking into this. If I made a
guess, I would say that the problem is in the no-copy rule.

** Changed in: zorba
     Assignee: Paul J. Lucas (paul-lucas) => Markos Zaharioudakis (markos-za)

You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.

  json 2.0 bug: json:serialize(json:parse(VALID_JSON))

Status in Zorba - The XQuery Processor:

Bug description:
  Should be possible to call json:serialize(json:parse(VALID_JSON))
  where VALID_JSON is any valid JSON string
  see added failing test test/rbkt/zorba/json/json-snelson-serialize-parse:

  import module namespace 
  declare variable $json-value := '{"html":"<b>bold</b>"}';

To manage notifications about this bug go to:

Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to