Tuesday, 20 August 2013

MarkLogic 5 return elements wrapped in CDATA

MarkLogic 5 return elements wrapped in CDATA

I'm trying to get MarkLogic 5 to return items wrapped in a CDATA tag but
it simply refuses to. Doesn't barf, just doesn't do it. Am I barking up
the wrong tree using: -
xquery version "1.0-ml";
declare option xdmp:output "cdata-section-elements = text";
<text><![CDATA[\begin{eqnarray}
\fl {R}_{\mathrm{sw}(e)}=\nonumber\\ \fl \biggl \{
\frac{3{L}_{1}{L}_{2}{Q}_{\mathrm{after}}}{1 2{k}_{h}{A}_{h}\Delta
T({L}_{1}+{L}_{2})-({L}_{1}+{L}_{2})^{2}({Q}_{\mathrm{before}}-{Q}_{\mathrm{after}})}-1\biggr
\} \nonumber\\ \times
~\frac{{L}_{1}{L}_{2}}{({L}_{1}+{L}_{2}){k}_{h}{A}_{h}}-{R}_{j}-{R}_{\mathrm{CNT}},
\end{eqnarray} ]]>
</text>
Simply returns without the CDATA tag which is contrary to all
documentation I can find. I've tried returning the content several ways,
e.g., xdmp:quote but as I need to parse the content using XSLT at the
other end it really needs to be wrapped in a CDATA element.
The content is normally deeply nested but I've simplified here for ease.
Any clues?

No comments:

Post a Comment