Q:

How is a newline transformed when using transform-from-json

In a rest extension I recieve json. Transform-from-json converts text including '/n'
let $jcodes     := '{code:"6626\n1012\n2536\n7890"}'
let $xml        := json:transform-from-json($jcodes)
return $xml

Gives in the query console:
<json type="object" xmlns="http://marklogic.com/xdmp/json/basic">
  <code type="string">6626
1012
2536
7890</code>
</json>

Question : What character is used to express the newline in de resultbox of the queryconsole?

A:

The function you want is fn:string-to-codepoints - and xdmp:describe can also be useful.
string-to-codepoints(
  json:transform-from-json(
    '{code:"6626\n1012\n2536\n7890"}'))

=> (54, 54, 50, 54, 10, 49, 48, 49, 50, 10, 50, 53, 51, 54, 10, 55, 56, 57, 48)

So the newline is codepoint 10, which matches what man ascii would tell you.
 The decimal set:

   0 nul    1 soh    2 stx    3 etx    4 eot    5 enq    6 ack    7 bel
   8 bs     9 ht    10 nl    11 vt    12 np    13 cr    14 so    15 si
  16 dle   17 dc1   18 dc2   19 dc3   20 dc4   21 nak   22 syn   23 etb

