If you really do have a parameter with an arity of ?, then it won’t be 
function mapping.  Function mapping only happens when a function parameter is 
specified to allow one-and-only-one.  In that case it’s unambiguous to map each 
item in a sequence onto a function call.  If a parameter is optional, then it 
isn’t.

   If you’re calling a function with more than one parameter, you could see 
function mapping on any of them.  If any parameter is a singleton, function 
mapping can happen.  A common trap is to pass a variable, which might be an 
empty sequence to a singleton parameter, which results in zero calls to the 
function.

   Or it could be namespaces.

---
Ron Hitchens {[email protected]}  +44 7879 358212

> On Aug 21, 2015, at 5:56 PM, Hasegawa, Margarete 
> <[email protected]> wrote:
> 
> Yes, I think function mapping is the most likely problem. Thanks for the link 
> documentation link. 
> 
> Maggie
> 
> From: Justin Makeig <[email protected] 
> <mailto:[email protected]>>
> Reply-To: MarkLogic Developer Discussion <[email protected] 
> <mailto:[email protected]>>
> Date: Friday, August 21, 2015 12:54 PM
> To: MarkLogic Developer Discussion <[email protected] 
> <mailto:[email protected]>>
> Subject: Re: [MarkLogic Dev General] Failure to enforce occurrence indicators 
> in function signature
> 
> You're likely running into function mapping 
> <http://docs.marklogic.com/guide/xquery/enhanced#id_55459 
> <http://docs.marklogic.com/guide/xquery/enhanced#id_55459>>.
> 
> Justin
> 
> 
>> On Aug 21, 2015, at 9:44 AM, Hasegawa, Margarete 
>> <[email protected] <mailto:[email protected]>> wrote:
>> 
>> Hi, 
>> 
>> Has anyone experienced an issue with MarkLogic failing to enforce occurrence 
>> indicators in function calls? For example, a function expects xs:string? 
>> (meaning that the function is expecting either the empty sequence or a 
>> single node), but instead accepts multiple values and does not fail. We've 
>> observed that instead of raising a syntax error, ML will sometimes give 
>> unpredictable behavior instead. Could this be a bug?
>> 
>> Many thanks!
>> Maggie 
>> 
>> _______________________________________________
>> General mailing list
>> [email protected] <mailto:[email protected]>
>> Manage your subscription at: 
>> http://developer.marklogic.com/mailman/listinfo/general 
>> <http://developer.marklogic.com/mailman/listinfo/general>
> 
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at: 
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to