[MarkLogic Dev General] xdmp:unquote issues in 1.0-ml: "invalid root text"

Eric Palmitesta eric.palmitesta at utoronto.ca
Fri Apr 24 12:43:58 PDT 2009


Anyone know what's changed in xdmp:unquote when moving from 0.9-ml to 
1.0-ml?

xquery version "0.9-ml"
let $value := <value>one &lt;b&gt;two&lt;/b&gt; three</value>
return xdmp:unquote($value/node())
=>
<v:results v:warning="more than one node">
   one
   <b>two</b>
   three
</v:results>

xquery version "1.0-ml";
(: same code as above :)
let $value := <value>one &lt;b&gt;two&lt;/b&gt; three</value>
return xdmp:unquote($value/node())
=>
[1.0-ml] XDMP-DOCROOTTEXT: xdmp:unquote("one <b>two</b> three") -- 
Invalid root text "one "

This works:

xquery version "1.0-ml";
let $value := <value>one &lt;b&gt;two&lt;/b&gt; three</value>
return xdmp:unquote(concat('<t>', $value/node(), '</t>'))
=>
<t>
   one
   <b>two</b>
   three
</t>

However, appending /node() doesn't change the output.  I would expect 
<t> and </t> to vanish:

xquery version "1.0-ml";
let $value := <value>one &lt;b&gt;two&lt;/b&gt; three</value>
return xdmp:unquote(concat('<t>', $value/node(), '</t>'))/node()
=>
<t>
   one
   <b>two</b>
   three
</t>

These examples were run on CQ, using MarkLogic 4.0-3, linux x86_64.

Eric


More information about the General mailing list