New map syntax issue
Wednesday, 18 September 2013 · 5 messages · last reply 19 Sep 2013
DK
Daniël Knippers18 Sep 2013 17:52 #
Hi,
Using the new map syntax of BaseX 7.7.1, I ran into this:
let $m := { 'key':'val' }
return $m('key')[XPST0003] Invalid key, simple expression expected.
As it turns out, a space is required after the closing quote of the key. That is, the above example works fine when replacing 'key':'val' by 'key'<SPACE>:'val'
This is not the case when using an integer key, i.e. this works fine:
let $m := { 1:'val' }
return $m(1)I'm not sure if this behavior is intentional, but I would guess it is not :-)
Regards,
Daniël
CG
Christian Grün18 Sep 2013 21:28 #
Hi Daniël,
the XQuery 3.1 grammar has not been finalized yet, but I agree that our implementation is not what one would expect. I have tracked your observation [1] and will let you know when a fix is available.
Thanks,
Christian
[1] https://github.com/BaseXdb/basex/issues/755
___________________________
2013/9/18 Daniël Knippers <dknippers at gmail.com>:
Quoted text · Daniël Knippers · 29 lines
> Hi, > > Using the new map syntax of BaseX 7.7.1, I ran into this: > > let $m := { 'key':'val' } > return $m('key') > > [XPST0003] Invalid key, simple expression expected. > > As it turns out, a space is required after the closing quote of the key. > That is, the above example works fine when replacing 'key':'val' by > 'key'<SPACE>:'val' > > This is not the case when using an integer key, i.e. this works fine: > > let $m := { 1:'val' } > return $m(1) > > I'm not sure if this behavior is intentional, but I would guess it is not > :-) > > Regards, > Daniël > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
DK
Daniël Knippers18 Sep 2013 21:38 #
Thank you for the swift reply Christian. Please do not feel obligated to let me know once this is fixed, it is not a blocking issue for me and I'm sure you can spend your time in better ways :-)
I'm already glad it's been picked up this quickly.
-- Daniël
On Wed, Sep 18, 2013 at 9:28 PM, Christian Grün
<christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 44 lines
> Hi Daniël, > > the XQuery 3.1 grammar has not been finalized yet, but I agree that > our implementation is not what one would expect. I have tracked your > observation [1] and will let you know when a fix is available. > > Thanks, > Christian > > [1] https://github.com/BaseXdb/basex/issues/755 > > ___________________________ > > 2013/9/18 Daniël Knippers <dknippers at gmail.com>: > > Hi, > > > > Using the new map syntax of BaseX 7.7.1, I ran into this: > > > > let $m := { 'key':'val' } > > return $m('key') > > > > [XPST0003] Invalid key, simple expression expected. > > > > As it turns out, a space is required after the closing quote of the key. > > That is, the above example works fine when replacing 'key':'val' by > > 'key'<SPACE>:'val' > > > > This is not the case when using an integer key, i.e. this works fine: > > > > let $m := { 1:'val' } > > return $m(1) > > > > I'm not sure if this behavior is intentional, but I would guess it is not > > :-) > > > > Regards, > > Daniël > > > > _______________________________________________ > > BaseX-Talk mailing list > > BaseX-Talk at mailman.uni-konstanz.de > > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > >
CG
Christian Grün18 Sep 2013 22:17 #
Quoted text · Daniël Knippers · 3 lines
> Thank you for the swift reply Christian. Please do not feel obligated to let > me know once this is fixed, it is not a blocking issue for me and I'm sure > you can spend your time in better ways :-)
No worries; we are glad to report that the issue is already fixed. Feel free to check out the latest snapshot [1]...
Best,
Christian
[1] http://files.basex.org/releases/latest/
___________________________
2013/9/18 Daniël Knippers <dknippers at gmail.com>:
Quoted text · Daniël Knippers · 54 lines
> > I'm already glad it's been picked up this quickly. > > -- Daniël > > On Wed, Sep 18, 2013 at 9:28 PM, Christian Grün <christian.gruen at gmail.com> > wrote: >> >> Hi Daniël, >> >> the XQuery 3.1 grammar has not been finalized yet, but I agree that >> our implementation is not what one would expect. I have tracked your >> observation [1] and will let you know when a fix is available. >> >> Thanks, >> Christian >> >> [1] https://github.com/BaseXdb/basex/issues/755 >> >> ___________________________ >> >> 2013/9/18 Daniël Knippers <dknippers at gmail.com>: >> > Hi, >> > >> > Using the new map syntax of BaseX 7.7.1, I ran into this: >> > >> > let $m := { 'key':'val' } >> > return $m('key') >> > >> > [XPST0003] Invalid key, simple expression expected. >> > >> > As it turns out, a space is required after the closing quote of the key. >> > That is, the above example works fine when replacing 'key':'val' by >> > 'key'<SPACE>:'val' >> > >> > This is not the case when using an integer key, i.e. this works fine: >> > >> > let $m := { 1:'val' } >> > return $m(1) >> > >> > I'm not sure if this behavior is intentional, but I would guess it is >> > not >> > :-) >> > >> > Regards, >> > Daniël >> > >> > _______________________________________________ >> > BaseX-Talk mailing list >> > BaseX-Talk at mailman.uni-konstanz.de >> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> > > >
DK
Daniël Knippers19 Sep 2013 00:26 #
That's some lightning fast bug fixing. Not only that, but I noticed you (and Leo) fixed it by removing a bunch of obsolete code and replaced it by a single line. Those are the best fixes ;)
Thanks to you both!
-- Daniël
On Wed, Sep 18, 2013 at 10:17 PM, Christian Grün
<christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 73 lines
> > Thank you for the swift reply Christian. Please do not feel obligated to > let > > me know once this is fixed, it is not a blocking issue for me and I'm > sure > > you can spend your time in better ways :-) > > No worries; we are glad to report that the issue is already fixed. > Feel free to check out the latest snapshot [1]... > > Best, > Christian > > [1] http://files.basex.org/releases/latest/ > ___________________________ > > 2013/9/18 Daniël Knippers <dknippers at gmail.com>: > > > > I'm already glad it's been picked up this quickly. > > > > -- Daniël > > > > On Wed, Sep 18, 2013 at 9:28 PM, Christian Grün < > christian.gruen at gmail.com> > > wrote: > >> > >> Hi Daniël, > >> > >> the XQuery 3.1 grammar has not been finalized yet, but I agree that > >> our implementation is not what one would expect. I have tracked your > >> observation [1] and will let you know when a fix is available. > >> > >> Thanks, > >> Christian > >> > >> [1] https://github.com/BaseXdb/basex/issues/755 > >> > >> ___________________________ > >> > >> 2013/9/18 Daniël Knippers <dknippers at gmail.com>: > >> > Hi, > >> > > >> > Using the new map syntax of BaseX 7.7.1, I ran into this: > >> > > >> > let $m := { 'key':'val' } > >> > return $m('key') > >> > > >> > [XPST0003] Invalid key, simple expression expected. > >> > > >> > As it turns out, a space is required after the closing quote of the > key. > >> > That is, the above example works fine when replacing 'key':'val' by > >> > 'key'<SPACE>:'val' > >> > > >> > This is not the case when using an integer key, i.e. this works fine: > >> > > >> > let $m := { 1:'val' } > >> > return $m(1) > >> > > >> > I'm not sure if this behavior is intentional, but I would guess it is > >> > not > >> > :-) > >> > > >> > Regards, > >> > Daniël > >> > > >> > _______________________________________________ > >> > BaseX-Talk mailing list > >> > BaseX-Talk at mailman.uni-konstanz.de > >> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >> > > > > > >
Written for BaseX 7.7. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery