I was wondering if it is possible to wrap the contents of a variable (that might contain messy html) into a cdata section.
I am using XQuery with eXist and I just can't seem to get it working.
I tried
<![CDATA[ $data ]]>
<![CDATA[ {$data} ]]>
In both cases the variable is not replaced by its contents, but remains $data and {$data} respectively.
I also tried using concat and other string functions, but these resulted in <![CDATA[
becoming <![CDATA[
.
The $data contains http get/post data from an html wysiwyg editor.
xquery version "1.0";
declare namespace request="http://exist-db.org/xquery/request";
let $data := request:get-parameter("content" , "")
return <![CDATA[ {$data} ]]>
Does anyone now how it should be done? Thanks in advance.