xquery:eval bug?

Thursday, 14 January 2016 · 8 messages · last reply 19 Jan 2016
MG
Marc van Grootel14 Jan 2016 23:17 #
Hi, I'm trying to return a map or an array from xquery:eval. Seems this is not possible, yet the signature says it returns item()*
    xquery:eval('1 + 1') => 2
    xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*)
have no string representation.
    xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of type
map(*) have no string representation.
BTW: I saw that xquery:eval#3 is documented as returning item() while the other arities return item()* Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I figure.
-- --Marc
CG
Christian Grün15 Jan 2016 18:57 #
Hi Marc, This was a deliberate restriction: As maps and arrays are function items, and as they can contain references to other functions that have been declared in the evaluated query, it is generally tricky to evaluate and return them dynamically. However, I spent some more thoughts on the underlying semantics, and I may have found a solution that overcomes some of the earlier limitations. A new snapshot is available [1], which now allows you to return function items (incl. maps and arrays) as result of xquery:eval. Your testing feedback will be welcome. Christian [1] http://files.basex.org/releases/latest/
Quoted text · Marc van Grootel · 20 lines
On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel <marc.van.grootel at gmail.com> wrote: > Hi, > > I'm trying to return a map or an array from xquery:eval. Seems this is > not possible, yet the signature says it returns item()* > > xquery:eval('1 + 1') => 2 > xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*) > have no string representation. > xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of type > map(*) have no string representation. > > BTW: I saw that xquery:eval#3 is documented as returning item() while > the other arities return item()* > > Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I figure. > > -- > --Marc
MG
Marc van Grootel18 Jan 2016 10:07 #
Hi Christian, Seems to work fine with latest snapshot with some straightforward cases but I do get an error in some cases which I cannot understand. Though I appreciate that it may be difficult to support all types of dynamic calls. The error is: [bxerr:BXXQ0001] No updating expression allowed. I am not using updating expressions. I also tried this in my little test project and it runs against the same error. I haven't been able to pinpoint it yet as it happens deep in the bowels of the code. When I'm able to I will let you know. You can use a simple/small set of unit tests to verify [1]. I've %unit:ignored the last test that causes the error above. Cheers, --Marc [1] https://github.com/xokomola/origami-examples/blob/master/check/test-eval.xqm
Quoted text · Christian Grün · 43 lines
On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Marc, > > This was a deliberate restriction: As maps and arrays are function > items, and as they can contain references to other functions that have > been declared in the evaluated query, it is generally tricky to > evaluate and return them dynamically. > > However, I spent some more thoughts on the underlying semantics, and I > may have found a solution that overcomes some of the earlier > limitations. > > A new snapshot is available [1], which now allows you to return > function items (incl. maps and arrays) as result of xquery:eval. Your > testing feedback will be welcome. > > Christian > > [1] http://files.basex.org/releases/latest/ > > > > On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel > <marc.van.grootel at gmail.com> wrote: >> Hi, >> >> I'm trying to return a map or an array from xquery:eval. Seems this is >> not possible, yet the signature says it returns item()* >> >> xquery:eval('1 + 1') => 2 >> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*) >> have no string representation. >> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of type >> map(*) have no string representation. >> >> BTW: I saw that xquery:eval#3 is documented as returning item() while >> the other arities return item()* >> >> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I figure. >> >> -- >> --Marc
-- --Marc
CG
Christian Grün18 Jan 2016 11:31 #
Hi Marc, It runs fine on my environment. Could you give me some more information on your set up (have you assigned any non-default options)? Christian
Quoted text · Marc van Grootel · 72 lines
On Mon, Jan 18, 2016 at 10:07 AM, Marc van Grootel <marc.van.grootel at gmail.com> wrote: > Hi Christian, > > Seems to work fine with latest snapshot with some straightforward > cases but I do get an error in some cases which I cannot understand. > Though I appreciate that it may be difficult to support all types of > dynamic calls. > > The error is: [bxerr:BXXQ0001] No updating expression allowed. > > I am not using updating expressions. I also tried this in my little > test project and it runs against the same error. I haven't been able > to pinpoint it yet as it happens deep in the bowels of the code. When > I'm able to I will let you know. > > You can use a simple/small set of unit tests to verify [1]. I've > %unit:ignored the last test that causes the error above. > > Cheers, > --Marc > > [1] https://github.com/xokomola/origami-examples/blob/master/check/test-eval.xqm > > On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün > <christian.gruen at gmail.com> wrote: >> Hi Marc, >> >> This was a deliberate restriction: As maps and arrays are function >> items, and as they can contain references to other functions that have >> been declared in the evaluated query, it is generally tricky to >> evaluate and return them dynamically. >> >> However, I spent some more thoughts on the underlying semantics, and I >> may have found a solution that overcomes some of the earlier >> limitations. >> >> A new snapshot is available [1], which now allows you to return >> function items (incl. maps and arrays) as result of xquery:eval. Your >> testing feedback will be welcome. >> >> Christian >> >> [1] http://files.basex.org/releases/latest/ >> >> >> >> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel >> <marc.van.grootel at gmail.com> wrote: >>> Hi, >>> >>> I'm trying to return a map or an array from xquery:eval. Seems this is >>> not possible, yet the signature says it returns item()* >>> >>> xquery:eval('1 + 1') => 2 >>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*) >>> have no string representation. >>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of type >>> map(*) have no string representation. >>> >>> BTW: I saw that xquery:eval#3 is documented as returning item() while >>> the other arities return item()* >>> >>> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I figure. >>> >>> -- >>> --Marc > > > > -- > --Marc
AB
Andy Bunce18 Jan 2016 12:27 #
Works for me if MIXUPDATES is not true. I have found previously that MIXUPDATES has a lot consequences that are not always desirable or predictable - at least for me. /Andy
Quoted text · Christian Grün · 86 lines
On 18 January 2016 at 10:31, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Marc, > > It runs fine on my environment. Could you give me some more > information on your set up (have you assigned any non-default > options)? > > Christian > > > On Mon, Jan 18, 2016 at 10:07 AM, Marc van Grootel > <marc.van.grootel at gmail.com> wrote: > > Hi Christian, > > > > Seems to work fine with latest snapshot with some straightforward > > cases but I do get an error in some cases which I cannot understand. > > Though I appreciate that it may be difficult to support all types of > > dynamic calls. > > > > The error is: [bxerr:BXXQ0001] No updating expression allowed. > > > > I am not using updating expressions. I also tried this in my little > > test project and it runs against the same error. I haven't been able > > to pinpoint it yet as it happens deep in the bowels of the code. When > > I'm able to I will let you know. > > > > You can use a simple/small set of unit tests to verify [1]. I've > > %unit:ignored the last test that causes the error above. > > > > Cheers, > > --Marc > > > > [1] > https://github.com/xokomola/origami-examples/blob/master/check/test-eval.xqm > > > > On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün > > <christian.gruen at gmail.com> wrote: > >> Hi Marc, > >> > >> This was a deliberate restriction: As maps and arrays are function > >> items, and as they can contain references to other functions that have > >> been declared in the evaluated query, it is generally tricky to > >> evaluate and return them dynamically. > >> > >> However, I spent some more thoughts on the underlying semantics, and I > >> may have found a solution that overcomes some of the earlier > >> limitations. > >> > >> A new snapshot is available [1], which now allows you to return > >> function items (incl. maps and arrays) as result of xquery:eval. Your > >> testing feedback will be welcome. > >> > >> Christian > >> > >> [1] http://files.basex.org/releases/latest/ > >> > >> > >> > >> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel > >> <marc.van.grootel at gmail.com> wrote: > >>> Hi, > >>> > >>> I'm trying to return a map or an array from xquery:eval. Seems this is > >>> not possible, yet the signature says it returns item()* > >>> > >>> xquery:eval('1 + 1') => 2 > >>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*) > >>> have no string representation. > >>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of type > >>> map(*) have no string representation. > >>> > >>> BTW: I saw that xquery:eval#3 is documented as returning item() while > >>> the other arities return item()* > >>> > >>> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro > I figure. > >>> > >>> -- > >>> --Marc > > > > > > > > -- > > --Marc >
MG
Marc van Grootelin reply to Christian Grün, 18 Jan 2016, 11:3118 Jan 2016 12:58 #
Hi Christian, Yes, I think so. I think MIXUPDATES=true could be the difference. I almost forgot about these as I always run basex from a Gradle script which sets these [1] [1] https://github.com/theapsgroup/basex-gradle-starter/blob/master/gradle.properties
Quoted text · Christian Grün · 102 lines
-----Original Message----- From: basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] On Behalf Of Christian Grün Sent: Monday, January 18, 2016 11:32 AM To: Marc van Grootel <marc.van.grootel at gmail.com> Cc: BaseX <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] xquery:eval bug? Hi Marc, It runs fine on my environment. Could you give me some more information on your set up (have you assigned any non-default options)? Christian On Mon, Jan 18, 2016 at 10:07 AM, Marc van Grootel <marc.van.grootel at gmail.com> wrote: > Hi Christian, > > Seems to work fine with latest snapshot with some straightforward > cases but I do get an error in some cases which I cannot understand. > Though I appreciate that it may be difficult to support all types of > dynamic calls. > > The error is: [bxerr:BXXQ0001] No updating expression allowed. > > I am not using updating expressions. I also tried this in my little > test project and it runs against the same error. I haven't been able > to pinpoint it yet as it happens deep in the bowels of the code. When > I'm able to I will let you know. > > You can use a simple/small set of unit tests to verify [1]. I've > %unit:ignored the last test that causes the error above. > > Cheers, > --Marc > > [1] > https://github.com/xokomola/origami-examples/blob/master/check/test-ev > al.xqm > > On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün > <christian.gruen at gmail.com> wrote: >> Hi Marc, >> >> This was a deliberate restriction: As maps and arrays are function >> items, and as they can contain references to other functions that >> have been declared in the evaluated query, it is generally tricky to >> evaluate and return them dynamically. >> >> However, I spent some more thoughts on the underlying semantics, and >> I may have found a solution that overcomes some of the earlier >> limitations. >> >> A new snapshot is available [1], which now allows you to return >> function items (incl. maps and arrays) as result of xquery:eval. Your >> testing feedback will be welcome. >> >> Christian >> >> [1] http://files.basex.org/releases/latest/ >> >> >> >> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel >> <marc.van.grootel at gmail.com> wrote: >>> Hi, >>> >>> I'm trying to return a map or an array from xquery:eval. Seems this >>> is not possible, yet the signature says it returns item()* >>> >>> xquery:eval('1 + 1') => 2 >>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*) >>> have no string representation. >>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of >>> type >>> map(*) have no string representation. >>> >>> BTW: I saw that xquery:eval#3 is documented as returning item() >>> while the other arities return item()* >>> >>> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I figure. >>> >>> -- >>> --Marc > > > > -- > --Marc This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________ '************************************************************************************************** This E-mail and any files transmitted with it are private and confidential and are solely for the use of the addressee. It may contain material which is legally privileged. If you are not the addressee, be advised that you have received this E-mail in error and that any use of it is strictly prohibited. If you have received this E-mail in error, please notify APS on +44 (0)161 495 4500, or E-mail administrator at theapsgroup.com. Any opinions expressed in the E-mail are those of the individual writer of it and not necessarily the Company unless specifically stated otherwise. There is no intention to create any legally binding contract or other commitment through use of this E-mail We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before downloading this E-mail and any attachments onto your computer system. Allied Publicity Services (Manchester) Ltd Registered Office: Allied Publicity Services (Manchester) Ltd, Chetham House, Bird Hall Lane, Cheadle Heath, Cheshire, SK3 0ZP Company Registration No: 681528 England APS Group Secure Solutions Limited. Registered Office: Chetham House, Bird Hall Lane, Stockport, Cheshire, SK3 0ZP Company Registration No: 07007434 England APS Group (Scotland) Ltd. Registered Office: APS Group (Scotland) Ltd, 21. Tennant Street, Edinburgh, EH6 5NA Company Registration No: SC369510 Scotland '************************************************************************************************** This E-mail and any files transmitted with it are private and confidential and are solely for the use of the addressee. It may contain material which is legally privileged. If you are not the addressee, be advised that you have received this E-mail in error and that any use of it is strictly prohibited. If you have received this E-mail in error, please notify APS on +44 (0)161 495 4500, or E-mail administrator at theapsgroup.com. Any opinions expressed in the E-mail are those of the individual writer of it and not necessarily the Company unless specifically stated otherwise. There is no intention to create any legally binding contract or other commitment through use of this E-mail We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before downloading this E-mail and any attachments onto your computer system. Allied Publicity Services (Manchester) Ltd Registered Office: Allied Publicity Services (Manchester) Ltd, Chetham House, Bird Hall Lane, Cheadle Heath, Cheshire, SK3 0ZP Company Registration No: 681528 England APS Group Secure Solutions Limited. Registered Office: Chetham House, Bird Hall Lane, Stockport, Cheshire, SK3 0ZP Company Registration No: 07007434 England APS Group (Scotland) Ltd. Registered Office: APS Group (Scotland) Ltd, 21. Tennant Street, Edinburgh, EH6 5NA Company Registration No: SC369510 Scotland This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com
CG
Christian Grün18 Jan 2016 13:51 #
Hi Marc, hi Andy, Confirmed, it seems to be the MIXUPDATES option. Once again, I noticed it’s tricky to statically detect which dynamic function calls will perform updates. Obviously, in the given case, there was no updating code at all, so the error message was a bit misleading. Feedback on the MIXUPDATES option is always welcome. I have just uploaded a new snapshot [1]. Christian [1] http://files.basex.org/releases/latest/
Quoted text · Marc van Grootel · 128 lines
On Mon, Jan 18, 2016 at 12:58 PM, Marc van Grootel <Marc.vanGrootel at theapsgroup.com> wrote: > Hi Christian, > > Yes, I think so. I think MIXUPDATES=true could be the difference. I almost forgot about these as I always run basex from a Gradle script which sets these [1] > > [1] https://github.com/theapsgroup/basex-gradle-starter/blob/master/gradle.properties > > -----Original Message----- > From: basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] On Behalf Of Christian Grün > Sent: Monday, January 18, 2016 11:32 AM > To: Marc van Grootel <marc.van.grootel at gmail.com> > Cc: BaseX <basex-talk at mailman.uni-konstanz.de> > Subject: Re: [basex-talk] xquery:eval bug? > > Hi Marc, > > It runs fine on my environment. Could you give me some more information on your set up (have you assigned any non-default options)? > > Christian > > > On Mon, Jan 18, 2016 at 10:07 AM, Marc van Grootel <marc.van.grootel at gmail.com> wrote: >> Hi Christian, >> >> Seems to work fine with latest snapshot with some straightforward >> cases but I do get an error in some cases which I cannot understand. >> Though I appreciate that it may be difficult to support all types of >> dynamic calls. >> >> The error is: [bxerr:BXXQ0001] No updating expression allowed. >> >> I am not using updating expressions. I also tried this in my little >> test project and it runs against the same error. I haven't been able >> to pinpoint it yet as it happens deep in the bowels of the code. When >> I'm able to I will let you know. >> >> You can use a simple/small set of unit tests to verify [1]. I've >> %unit:ignored the last test that causes the error above. >> >> Cheers, >> --Marc >> >> [1] >> https://github.com/xokomola/origami-examples/blob/master/check/test-ev >> al.xqm >> >> On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün >> <christian.gruen at gmail.com> wrote: >>> Hi Marc, >>> >>> This was a deliberate restriction: As maps and arrays are function >>> items, and as they can contain references to other functions that >>> have been declared in the evaluated query, it is generally tricky to >>> evaluate and return them dynamically. >>> >>> However, I spent some more thoughts on the underlying semantics, and >>> I may have found a solution that overcomes some of the earlier >>> limitations. >>> >>> A new snapshot is available [1], which now allows you to return >>> function items (incl. maps and arrays) as result of xquery:eval. Your >>> testing feedback will be welcome. >>> >>> Christian >>> >>> [1] http://files.basex.org/releases/latest/ >>> >>> >>> >>> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel >>> <marc.van.grootel at gmail.com> wrote: >>>> Hi, >>>> >>>> I'm trying to return a map or an array from xquery:eval. Seems this >>>> is not possible, yet the signature says it returns item()* >>>> >>>> xquery:eval('1 + 1') => 2 >>>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*) >>>> have no string representation. >>>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of >>>> type >>>> map(*) have no string representation. >>>> >>>> BTW: I saw that xquery:eval#3 is documented as returning item() >>>> while the other arities return item()* >>>> >>>> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I figure. >>>> >>>> -- >>>> --Marc >> >> >> >> -- >> --Marc > > ______________________________________________________________________ > This email has been scanned by the Symantec Email Security.cloud service. > For more information please visit http://www.symanteccloud.com ______________________________________________________________________ > '************************************************************************************************** > This E-mail and any files transmitted with it are private and confidential and are solely for the use of the addressee. It may contain material which is legally privileged. If you are not the addressee, be advised that you have received this E-mail in error and that any use of it is strictly prohibited. > > If you have received this E-mail in error, please notify APS on +44 (0)161 495 4500, or E-mail administrator at theapsgroup.com. > Any opinions expressed in the E-mail are those of the individual writer of it and not necessarily the Company unless specifically stated otherwise. There is no intention to create any legally binding contract or other commitment through use of this E-mail > > We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before downloading this E-mail and any attachments onto your computer system. > > Allied Publicity Services (Manchester) Ltd Registered Office: Allied Publicity Services (Manchester) Ltd, Chetham House, Bird Hall Lane, Cheadle Heath, Cheshire, SK3 0ZP Company Registration No: 681528 England > > APS Group Secure Solutions Limited. Registered Office: Chetham House, Bird Hall Lane, Stockport, Cheshire, SK3 0ZP Company Registration No: 07007434 England APS Group (Scotland) Ltd. Registered Office: APS Group (Scotland) Ltd, 21. Tennant Street, Edinburgh, EH6 5NA Company Registration No: SC369510 Scotland > '************************************************************************************************** > This E-mail and any files transmitted with it are private and confidential and are solely for the use of the addressee. It may contain material which is legally privileged. If you are not the addressee, be advised that you have received this E-mail in error and that any use of it is strictly prohibited. > > If you have received this E-mail in error, please notify APS on +44 (0)161 495 4500, or E-mail administrator at theapsgroup.com. > Any opinions expressed in the E-mail are those of the individual writer of it and not necessarily the Company unless specifically stated otherwise. There is no intention to create any legally binding contract or other commitment through use of this E-mail > > We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before downloading this E-mail and any attachments onto your computer system. > > Allied Publicity Services (Manchester) Ltd Registered Office: Allied Publicity Services (Manchester) Ltd, Chetham House, Bird Hall Lane, Cheadle Heath, Cheshire, SK3 0ZP Company Registration No: 681528 England > > APS Group Secure Solutions Limited. Registered Office: Chetham House, Bird Hall Lane, Stockport, Cheshire, SK3 0ZP Company Registration No: 07007434 England > APS Group (Scotland) Ltd. Registered Office: APS Group (Scotland) Ltd, 21. Tennant Street, Edinburgh, EH6 5NA Company Registration No: SC369510 Scotland > > ______________________________________________________________________ > This email has been scanned by the Symantec Email Security.cloud service. > For more information please visit http://www.symanteccloud.com > ______________________________________________________________________
MG
Marc van Grootel19 Jan 2016 13:08 #
And I can confirm that my code now also runs when MIXUPDATES=true Although the code isn't meant to be shared yet as it's very much WIP here's the example I"m running: https://github.com/xokomola/origami-examples/blob/master/check/check-demo.xq It's running all the Origami test cases via a custom built test harness (tests are evaluated via xquery:eval). --Marc
Quoted text · Christian Grün · 146 lines
On Mon, Jan 18, 2016 at 1:51 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Marc, hi Andy, > > Confirmed, it seems to be the MIXUPDATES option. Once again, I noticed > it’s tricky to statically detect which dynamic function calls will > perform updates. Obviously, in the given case, there was no updating > code at all, so the error message was a bit misleading. > > Feedback on the MIXUPDATES option is always welcome. I have just > uploaded a new snapshot [1]. > > Christian > > [1] http://files.basex.org/releases/latest/ > > > > On Mon, Jan 18, 2016 at 12:58 PM, Marc van Grootel > <Marc.vanGrootel at theapsgroup.com> wrote: >> Hi Christian, >> >> Yes, I think so. I think MIXUPDATES=true could be the difference. I almost forgot about these as I always run basex from a Gradle script which sets these [1] >> >> [1] https://github.com/theapsgroup/basex-gradle-starter/blob/master/gradle.properties >> >> -----Original Message----- >> From: basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] On Behalf Of Christian Grün >> Sent: Monday, January 18, 2016 11:32 AM >> To: Marc van Grootel <marc.van.grootel at gmail.com> >> Cc: BaseX <basex-talk at mailman.uni-konstanz.de> >> Subject: Re: [basex-talk] xquery:eval bug? >> >> Hi Marc, >> >> It runs fine on my environment. Could you give me some more information on your set up (have you assigned any non-default options)? >> >> Christian >> >> >> On Mon, Jan 18, 2016 at 10:07 AM, Marc van Grootel <marc.van.grootel at gmail.com> wrote: >>> Hi Christian, >>> >>> Seems to work fine with latest snapshot with some straightforward >>> cases but I do get an error in some cases which I cannot understand. >>> Though I appreciate that it may be difficult to support all types of >>> dynamic calls. >>> >>> The error is: [bxerr:BXXQ0001] No updating expression allowed. >>> >>> I am not using updating expressions. I also tried this in my little >>> test project and it runs against the same error. I haven't been able >>> to pinpoint it yet as it happens deep in the bowels of the code. When >>> I'm able to I will let you know. >>> >>> You can use a simple/small set of unit tests to verify [1]. I've >>> %unit:ignored the last test that causes the error above. >>> >>> Cheers, >>> --Marc >>> >>> [1] >>> https://github.com/xokomola/origami-examples/blob/master/check/test-ev >>> al.xqm >>> >>> On Fri, Jan 15, 2016 at 6:57 PM, Christian Grün >>> <christian.gruen at gmail.com> wrote: >>>> Hi Marc, >>>> >>>> This was a deliberate restriction: As maps and arrays are function >>>> items, and as they can contain references to other functions that >>>> have been declared in the evaluated query, it is generally tricky to >>>> evaluate and return them dynamically. >>>> >>>> However, I spent some more thoughts on the underlying semantics, and >>>> I may have found a solution that overcomes some of the earlier >>>> limitations. >>>> >>>> A new snapshot is available [1], which now allows you to return >>>> function items (incl. maps and arrays) as result of xquery:eval. Your >>>> testing feedback will be welcome. >>>> >>>> Christian >>>> >>>> [1] http://files.basex.org/releases/latest/ >>>> >>>> >>>> >>>> On Thu, Jan 14, 2016 at 11:17 PM, Marc van Grootel >>>> <marc.van.grootel at gmail.com> wrote: >>>>> Hi, >>>>> >>>>> I'm trying to return a map or an array from xquery:eval. Seems this >>>>> is not possible, yet the signature says it returns item()* >>>>> >>>>> xquery:eval('1 + 1') => 2 >>>>> xquery:eval('[1,2]') => ERROR: [FOTY0014] Items of type array(*) >>>>> have no string representation. >>>>> xquery:eval('map { "x": 10 }') => ERROR: [FOTY0014] Items of >>>>> type >>>>> map(*) have no string representation. >>>>> >>>>> BTW: I saw that xquery:eval#3 is documented as returning item() >>>>> while the other arities return item()* >>>>> >>>>> Tested on 8.3, haven't tested yet on 8.4beta but it's trivial to repro I figure. >>>>> >>>>> -- >>>>> --Marc >>> >>> >>> >>> -- >>> --Marc >> >> ______________________________________________________________________ >> This email has been scanned by the Symantec Email Security.cloud service. >> For more information please visit http://www.symanteccloud.com ______________________________________________________________________ >> '************************************************************************************************** >> This E-mail and any files transmitted with it are private and confidential and are solely for the use of the addressee. It may contain material which is legally privileged. If you are not the addressee, be advised that you have received this E-mail in error and that any use of it is strictly prohibited. >> >> If you have received this E-mail in error, please notify APS on +44 (0)161 495 4500, or E-mail administrator at theapsgroup.com. >> Any opinions expressed in the E-mail are those of the individual writer of it and not necessarily the Company unless specifically stated otherwise. There is no intention to create any legally binding contract or other commitment through use of this E-mail >> >> We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before downloading this E-mail and any attachments onto your computer system. >> >> Allied Publicity Services (Manchester) Ltd Registered Office: Allied Publicity Services (Manchester) Ltd, Chetham House, Bird Hall Lane, Cheadle Heath, Cheshire, SK3 0ZP Company Registration No: 681528 England >> >> APS Group Secure Solutions Limited. Registered Office: Chetham House, Bird Hall Lane, Stockport, Cheshire, SK3 0ZP Company Registration No: 07007434 England APS Group (Scotland) Ltd. Registered Office: APS Group (Scotland) Ltd, 21. Tennant Street, Edinburgh, EH6 5NA Company Registration No: SC369510 Scotland >> '************************************************************************************************** >> This E-mail and any files transmitted with it are private and confidential and are solely for the use of the addressee. It may contain material which is legally privileged. If you are not the addressee, be advised that you have received this E-mail in error and that any use of it is strictly prohibited. >> >> If you have received this E-mail in error, please notify APS on +44 (0)161 495 4500, or E-mail administrator at theapsgroup.com. >> Any opinions expressed in the E-mail are those of the individual writer of it and not necessarily the Company unless specifically stated otherwise. There is no intention to create any legally binding contract or other commitment through use of this E-mail >> >> We cannot accept any liability for any loss or damage sustained as a result of software viruses. It is your responsibility to carry out such virus checking as is necessary before downloading this E-mail and any attachments onto your computer system. >> >> Allied Publicity Services (Manchester) Ltd Registered Office: Allied Publicity Services (Manchester) Ltd, Chetham House, Bird Hall Lane, Cheadle Heath, Cheshire, SK3 0ZP Company Registration No: 681528 England >> >> APS Group Secure Solutions Limited. Registered Office: Chetham House, Bird Hall Lane, Stockport, Cheshire, SK3 0ZP Company Registration No: 07007434 England >> APS Group (Scotland) Ltd. Registered Office: APS Group (Scotland) Ltd, 21. Tennant Street, Edinburgh, EH6 5NA Company Registration No: SC369510 Scotland >> >> ______________________________________________________________________ >> This email has been scanned by the Symantec Email Security.cloud service. >> For more information please visit http://www.symanteccloud.com >> ______________________________________________________________________
-- --Marc

⚡Generated with XQuery