[xquery-talk] function() inside of an element ?

William Candillon wcandillon at gmail.com
Fri Jan 31 01:21:27 PST 2014


Here's an example with a map extension (JSONiq in this instance):
let $obj := {
    hello: function(){
        "Hello World"
    }
}
return $obj.hello()

http://try.zorba.io/queries/xquery/y5RSvf%2FQpvfNSvB%2Fep%2BE3H2hYcA%3D


On Fri, Jan 31, 2014 at 12:23 AM, Misztur, Chris
<CMisztur at macleanfogg.com> wrote:
> Understood, thanks.
>
> On Jan 30, 2014, at 5:06 PM, "David Lee" <dlee at calldei.com> wrote:
>
> yes to all that (except maps which are vendor specific)
>
>
>
> declare variable $a := function() { true() } ;
>
> ..
>
>
>
> return $a()
>
>
>
> let $x := ( 1 , $a , 2 )
>
> return ($x[2])()
>
>
>
> but elements no ... sticking a function into an element atomizes the
> function itself which is not allowed ... a sad state of affairs (unless you
> want to serialize the XML as well XML ... then its great )
>
>
>
>
>
> From: Misztur, Chris [mailto:CMisztur at macleanfogg.com]
> Sent: Thursday, January 30, 2014 5:26 PM
> To: David Lee
> Cc: talk at x-query.com
> Subject: Re: [xquery-talk] function() inside of an element ?
>
>
>
> Err the last arguments should be variables.
>
>
> On Jan 30, 2014, at 4:24 PM, "Misztur, Chris" <CMisztur at macleanfogg.com>
> wrote:
>
> Better yet, is it possible to store a function in a map whose arguments are
> known at runtime.  In other words the functions arguments do not reference
> any existing arguments at design time.
>
>
> On Jan 30, 2014, at 4:11 PM, "David Lee" <dlee at calldei.com> wrote:
>
> No.
>
>
>
>
>
> From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf
> Of Misztur, Chris
> Sent: Thursday, January 30, 2014 5:07 PM
> To: talk at x-query.com
> Subject: [xquery-talk] function() inside of an element ?
>
>
>
> Is it possible to call the function stored inside of $el?
>
>
>
> Let $el := element f { function() { true() } }
>
>
>
>
>
> ________________________________
>
>
> The contents of this message may be privileged and confidential. Therefore,
> if this message has been received in error, please delete it without reading
> it. Your receipt of this message is not intended to waive any applicable
> privilege. Please do not disseminate this message without the permission of
> the author.
>
> Please consider the environment before printing this e-mail
>
>
>
> ________________________________
>
>
> The contents of this message may be privileged and confidential. Therefore,
> if this message has been received in error, please delete it without reading
> it. Your receipt of this message is not intended to waive any applicable
> privilege. Please do not disseminate this message without the permission of
> the author.
>
> Please consider the environment before printing this e-mail
>
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk
>
>
>
> ________________________________
>
>
> The contents of this message may be privileged and confidential. Therefore,
> if this message has been received in error, please delete it without reading
> it. Your receipt of this message is not intended to waive any applicable
> privilege. Please do not disseminate this message without the permission of
> the author.
>
> Please consider the environment before printing this e-mail
>
>
> ________________________________
>
> The contents of this message may be privileged and confidential. Therefore,
> if this message has been received in error, please delete it without reading
> it. Your receipt of this message is not intended to waive any applicable
> privilege. Please do not disseminate this message without the permission of
> the author.
>
> Please consider the environment before printing this e-mail
>
>
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk


More information about the talk mailing list