From: Martin H. <mh...@uv...> - 2013-09-27 14:55:00
|
Hi Peter, I updated my app to a very recent build from git, and my code now runs OK, but I also tested Wolfgang's code from the bug report, and that problem is still there. So something has changed since May, but there's still clearly an issue. Cheers, Martin On 13-09-27 02:08 AM, Peter Stadler wrote: > Martin, > > I tried the example from the bug tracker and I can confirm that the issue still holds. > But, changing the example (only relevant lines) to > > for $dwellers in $zoo//dweller > let $kind := $dwellers/@kind > let $count := count($dwellers) > group by $kind > order by $kind > return ... > > did actually work for me (while changing to "order by $count" did not.) > So, it seems to me that using the identical variable for group and order key should work which makes me wonder why it doesn't for your example?! > > Best > Peter > > > Am 26.09.2013 um 00:33 schrieb Martin Holmes <mholmes@UVIC.CA>: > >> Looking through the tracker, I find this bug: >> >> <https://sourceforge.net/p/exist/bugs/796/> >> >> which seems related, but has been open and untouched for nearly a year. >> >> Cheers, >> Martin >> >> On 13-09-25 01:43 PM, Martin Holmes wrote: >>> Running eXist 2.1 rev 18438, I have a function like this: >>> >>> declare function local:showIndex($indexName as xs:string) as node()*{ >>> <xh:ul> >>> { >>> for $term in collection('/db/data/')//index[@indexName=$indexName]/term >>> let $text := normalize-space($term) >>> group by $text >>> order by $text >>> return >>> <xh:li>{$term}</xh:li> >>> } >>> </xh:ul> >>> }; >>> >>> I get this error: >>> >>> "err:XPDY0002 variable '$text' is not set." >>> >>> pointing at the line "order by $text". If I remove that line, the >>> function works fine. The sequence of group by followed by order by is >>> taken directly from one of the XQuery 3.0 use-cases: >>> >>> <http://www.w3.org/TR/xquery-30-use-cases/#groupby> >>> >>> so I'm not sure why it would fail here. What am I missing? >>> >>> Cheers, >>> Martin >>> >>> >>> ------------------------------------------------------------------------------ >>> October Webinars: Code for Performance >>> Free Intel webinars can help you accelerate application performance. >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from >>> the latest Intel processors and coprocessors. See abstracts and register > >>> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk >>> >> >> >> ------------------------------------------------------------------------------ >> October Webinars: Code for Performance >> Free Intel webinars can help you accelerate application performance. >> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from >> the latest Intel processors and coprocessors. See abstracts and register > >> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk >> _______________________________________________ >> Exist-open mailing list >> Exi...@li... >> https://lists.sourceforge.net/lists/listinfo/exist-open > > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > |