On Mon, 24 Aug 2015 14:18:51 -0700, Danny Sinang <[email protected]>  
wrote:

> Hi Mary,
>
> I tried adding
>
> *declare option **xdmp:output* "cdata-section-elements=title";
>
> to my script, but my titles still don't become CDATA.
>
> However, entering "title" in the *output cdata section localname *app
> server config worked.
>
> Any idea what I could be missing ? Am using ML 8.0-3 .
>
> Regards,
> Danny
>

Are you testing this out in QConsole?  It won't work, because QConsole is  
running your query as an eval and it is the settings for the outer query  
that matter for serialization purposes, not the settings in the inner  
query.

declare option xdmp:output "cdata-section-elements=title";

will work if it is in a module that you execute directly.  What I mean is,  
you have an application server with a root of
/wherever/ on the filesystem and you have a module /whatever/foo.xqy that  
has that option set in it, or you have an appserver with a root of  
/something/ in the Modules database and you have /something/foo.xqy in the  
Modules database with that set: if you access that URI to execute that  
module, then you will be using that module's serialization and then it  
will apply.

//Mary

>
> On Tue, May 5, 2015 at 9:40 AM, Mary Holstege  
> <[email protected]>
> wrote:
>
>>
>> If you really want CDATA escaping for certain elements, you can use the
>> output options to control this.
>>
>> See https://docs.marklogic.com/guide/app-dev/appserver-control#id_86940
>> for how to set output options at the appserver level and
>> https://docs.marklogic.com/guide/xquery/langoverview#id_71572 for how to
>> do so on a query by query level using prolog options.
>>
>> In your case, putting this at the top of your query should do it:
>>
>> declare option xdmp:output "cdata-section-elements=text";
>>
>> Note, however, that testing this via QConsole won't be effective,
>> because of the way QConsole works, its own serialization options will
>> win out.
>>
>> //Mary
>>
>> On 05/05/2015 04:42 AM, Florent Georges wrote:
>> >    Hi,
>> >
>> >    First I guess your question has nothing to do with the email you
>> quote.
>> >
>> >    You need to ask the question why you need CDATA.  You most likely  
>> do
>> > not.  Why is the following result not good for you?
>> >
>> >      <text>&lt;p&gt;Sample content of a P element.&lt;/p&gt;</text>
>> >
>> >    Regards,
>> >
>> _______________________________________________
>> General mailing list
>> [email protected]
>> Manage your subscription at:
>> http://developer.marklogic.com/mailman/listinfo/general
>>


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to