You are right Mary. I have missed the syntax. Thanks for the quick help. I 
really appreciate.

Regards,
Prabhakar Aluri

From: [email protected] 
[mailto:[email protected]] On Behalf Of Mary Holstege
Sent: Friday, June 19, 2015 12:18 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] CPF Pipeline Issue

It looks to me like you have a syntax error. It should be

<xi:include="{$cpf:document-uri}"/>

//Mary
On 06/18/2015 11:37 AM, Aluri, Venkata Seshu Prabhakar wrote:
I have created a CPF pipeline on my database and I am trying to create a new 
document in my action module on “initial” state. This new document is a modular 
document which should include the document that is being loaded. The action is 
getting failed when I use <xi:include> tag in my code. Is there any restriction 
on using this include in action module?

Appreciate any insights into the issue.

Below is my action module code :

xquery version "1.0-ml";
import module namespace cpf = 
"http://marklogic.com/cpf";<http://marklogic.com/cpf>
at "/MarkLogic/cpf/cpf.xqy";
declare namespace 
xi="http://www.w3.org/2001/XInclude";<http://www.w3.org/2001/XInclude>;
declare variable $cpf:document-uri as xs:string external;
declare variable $cpf:transition as node() external;
if (cpf:check-transition($cpf:document-uri,$cpf:transition)) then try
{
let $doc := fn:replace($cpf:document-uri,'/abc/','/bcd/')
return
xdmp:document-insert(
$doc,
<rootelem>
<xi:include href=$cpf:document-uri />
</ rootelem >),
xdmp:log( "add file ran OK" ),
xdmp:log( $cpf:document-uri ),
cpf:success( $cpf:document-uri, $cpf:transition, () )
}
catch ($e) {
cpf:failure( $cpf:document-uri, $cpf:transition, $e, () )
}
else ()

Error message in the log file:

2015-06-18 19:59:35.992  Error: TaskServer: mlpoc: on-state-enter 
/abc/newfile.xml action failed
2015-06-18 19:59:36.273 Error: TaskServer: mlpoc: cpf:failure /abc/newfile.xml 
executing http://marklogic.com/states/initial

Regards,
Prabhakar Aluri


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.




_______________________________________________

General mailing list

[email protected]<mailto:[email protected]>

Manage your subscription at:

http://developer.marklogic.com/mailman/listinfo/general


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to