问题描述:

Ok i am trying to decode a base64 encoded rtf doc in MarkLogic.

xquery version "1.0-ml";

declare namespace cdm = "http://example.nl/cdm/1.2";

let $inh := <cdm:inhoud>

Large base64 encoded RTF doc here

</cdm:inhoud>

let $pv := $inh/text()

(:

let $decodedDoc := document {xdmp:document-filter( text{ xdmp:base64-decode($pv) } )}

:)

return document {xdmp:document-filter( text{ xdmp:base64-decode($pv) } )}

I get this error:

 SVC-PROCESSRUN: xdmp:document-filter(text{"{\rtf1\ansi\ansicpg1252\uc1\deff1{\fonttbl&#13;&#10;{\f0\fnil\fc..."}) -- Process run error: fork: Cannot allocate memory

Running only

xdmp:base64-decode($pv)

Decodes the rtf file but really messy...

Does my server have not enough memory?

网友答案:

I think the problem is mostly that you force MarkLogic to keep the entire decoded string as well as the filtered result in memory. It would help if you wouldn't need to decode inside this code, and search a doc or request body directly into document-filter. Also don't wrap document-filter result inside a document constructor. It already returns a document node.

HTH!

相关阅读:
Top