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 json:serialize(...).
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.
I investigated this issue a little more. The problem seems to be in the optimizer.
zorba -q tmp.xq -f --optimization- level O0
returns the correct result.
<?xml version="1.0" encoding="UTF-8"?> :"<b& gt;bold& lt;/b> "}
{"html"
whereas
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 json:serialize( ...).
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.