I'm working with XML to JSON conversion in XQuery for the content with special characters.
XML :
<text>$$\parent* \$$</text>
Using json:transform-to-json() with custom config, getting the below result
Actual result: { "text": "$$\\parent* \\$$" }
Expected result :
{"text": "$$\parent* \$$"}
I tried multiple ways like using xdmp:quote() and xdmp:to-json() methods but not giving the expected result.
Is there a way to restrict the addition of extra backslash during conversion in XQuery?