Thanks for the reply. I had not thought that this is really just the Java stack.
After reviewing the code I noticed the XQuery parser was created some time ago.
The new version runs with the default stack for me [1]

/Andy
[1] https://github.com/expkg-zone58/ex-xparse/releases/tag/v0.2.1

On 20 November 2015 at 12:38, Christian Grün <christian.gruen@gmail.com> wrote:
Hi Andy,

Sorry for the late reply. I can reproduce the behavior you have been
describing, and I agree it’s quite surprising. I have no idea what’s
the reason for that; my assumption is that the Java stack size is
increased after a while (?).

As you may know, the stack size can be increased via an JVM option in
the BaseX script. With -Xss2m, your query will be successfully
executed with the first run.

Hope this helps,
Christian


On Thu, Nov 12, 2015 at 10:13 PM, Andy Bunce <bunce.andy@gmail.com> wrote:
> Hi,
>
> Using a fresh install on 8.3.1 and running  basexgui.bat on windows.
> I install this expath package
>
> https://github.com/expkg-zone58/ex-xparse/releases/download/v0.0.5/ex-xparse-0.0.5.xar
>
> Then, paste the following code into an editor window..
> ------------------------
> import module namespace xp="http://expath.org/ns/xparse";
>
> "http://www.xqueryfunctions.com/xq/functx-1.0-doc-2007-01.xq"
> !unparsed-text(.)
> !xp:parse(.,map{"lang":"xquery"})
> -----------------------
> The result is the error...
> Stack Overflow: Try tail recursion?
>
> The curious part is..
>  if I keep retrying by clicking the execute button - after around 10 tries
> it starts working and seems to continue to work every time after that within
> that GUI instance.
> I have reproduced this on another pc.
>
> /Andy
>
>