Hi MarkLogic allows for function overloading. Perhaps that could be your solution..
Kind Regards, David Ennis Kind Regards, David Ennis David Ennis *Content Engineer* [image: HintTech] <http://www.hinttech.com/> Mastering the value of content creative | technology | content Delftechpark 37i 2628 XJ Delft The Netherlands T: +31 88 268 25 00 M: +31 63 091 72 80 [image: http://www.hinttech.com] <http://www.hinttech.com> <https://twitter.com/HintTech> <http://www.facebook.com/HintTech> <http://www.linkedin.com/company/HintTech> On 26 September 2014 13:00, Kapoor, Pragya <[email protected]> wrote: > Hi, > > > I need to pass an empty value to util function, which is not working. > > > declare function xutils:validateSession($sessionId as xs:string) { > > if($sessionId ne "" ) then > let $document := fn:doc($config:USER_SESSIONS) > <errorCode> > <code>500</code> > <description>server error</description> > </errorCode> > else > <errorCode> > <code>517</code> > <description>Session Id can't be empty</description> > </errorCode> > > }; > > I am calling this function from some other file and it is returing an > empty sequence.But if I make this function local:validateSession($sessionId > as xs:string) then its working. > > Calling file: > import module namespace config = "config" > at "/rest-apis/utils/config.xqy"; > > let $node := '<inputString> > > <sessionId></sessionId> > </inputString>' > > > > let $node := xdmp:unquote($node) > let $sessionId := $node//sessionId/text() > return > let $validateFlag := xutils:validateSession($sessionId) > return > > $validateFlag > > Please advice. > > Thanks > Pragya > > > "This e-mail and any attachments transmitted with it are for the sole use > of the intended recipient(s) and may contain confidential , proprietary or > privileged information. If you are not the intended recipient, please > contact the sender by reply e-mail and destroy all copies of the original > message. Any unauthorized review, use, disclosure, dissemination, > forwarding, printing or copying of this e-mail or any action taken in > reliance on this e-mail is strictly prohibited and may be unlawful." > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > >
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
