Hi, Prakash:

The % calls before the functions are XQuery function annotations (similar in 
spirit to @ annotations in Java).

An example of a function reference would be cim:up#0 or cim:build#

If you provide the code that's reporting an error with the error, it should be 
possible to identify what to tweak.


Erik Hennum


________________________________
From: [email protected] 
[[email protected]] on behalf of Prakashkumar Patel 
[[email protected]]
Sent: Wednesday, July 19, 2017 4:59 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Understanding the syntax


Thanks a lot Erik for the response.


I tried to see how that works from qconsole but it errored out. Could you 
please create a quick example of its usage so that I can run from qconsole 
directly and see how it works? This will be really helpful.


Additionally, I had one more spot that amazed me. In the code snippet below, 
can you let me know if this is right syntax for functin declaration (of cours 
eit is right coz it works in qconsole) and what is significance of 
%cim:description.


declare %cim:description(1,"call")
function cim:build() as xs:string {
    "Some string"
};

declare %cim:description(2,"One more call")
function cim:up() as xs:string {
    "Different string"
};
​


Thanks,

Prakash





________________________________
From: [email protected] 
<[email protected]> on behalf of Erik Hennum 
<[email protected]>
Sent: Thursday, July 13, 2017 6:40 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Understanding the syntax

Hi, Prakash:

mo:cleanup-table#1 is a reference to the cleanup-table function in the 
namespace for the mo prefix that takes a single parameter.

The code is putting the function reference in a map.  Presumably, later code 
gets the 'table' function reference from the map and calls the function, 
passing a single parameter.


Hoping that helps,


Erik Hennum
________________________________
From: [email protected] 
[[email protected]] on behalf of Prakashkumar Patel 
[[email protected]]
Sent: Thursday, July 13, 2017 5:38 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Understanding the syntax



Hi,


I was looking out into a codebase that needs enhancement and I came across 
something as below. I am not much clear on what  'mo:cleanup-table#1' does. I 
checked there is a function 'mo:cleanup-table​' in the repository. Can someone 
explain what does mo:cleanup-table#1​ do?


let $_:=map:put($ht:override,'table',mo:cleanup-table#1)​


Thanks,

Prakash





=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to