Hi,

I got an "Improper use? Potential bug?” error (see below) with a (complex) query which actually works when applied to many files (but not to all). This is the query (temporary links):

https://git.informatik.uni-leipzig.de/celano/latinnlp/-/blob/master/scripts/03.00_normalize_spelling.xq

applied to all files here:

https://git.informatik.uni-leipzig.de/celano/latinnlp/-/tree/master/texts/parsed-texts

Essentially, I have some words associated to an XPath expression + offsets (see, for example, [1]), which (words) I can retrieve by using substring($xpath, $start, $long) applied to [2]. My goal is to try to identify the text nodes the words are children of, because I want to check whether they are contained in some specific elements.

Ciao,
Giuseppe


[1] https://git.informatik.uni-leipzig.de/celano/latinnlp/-/blob/master/texts/parsed-texts/phi2331.phi005.perseus-lat2/phi2331.phi005.perseus-lat2.tok01.xml
[2] https://git.informatik.uni-leipzig.de/celano/latinnlp/-/blob/master/texts/parsed-texts/phi2331.phi005.perseus-lat2/phi2331.phi005.perseus-lat2.xml
---

Error:
Improper use? Potential bug? Your feedback is welcome:
Contact: basex-talk@mailman.uni-konstanz.de
Version: BaseX 9.3.2
Java: Ubuntu, 11.0.9.1
OS: Linux, amd64
Stack Trace:
java.lang.ArrayIndexOutOfBoundsException: Maximum array size reached.
at org.basex.util.Array.newSize(Array.java:299)
at org.basex.util.Array.newSize(Array.java:288)
at org.basex.util.TokenBuilder.add(TokenBuilder.java:267)
at org.basex.util.TokenBuilder.add(TokenBuilder.java:252)
at org.basex.query.QueryInfo.toString(QueryInfo.java:142)
at org.basex.query.QueryContext.info(QueryContext.java:474)
at org.basex.query.QueryProcessor.info(QueryProcessor.java:272)
at org.basex.core.cmd.AQuery.extError(AQuery.java:212)
at org.basex.core.cmd.AQuery.query(AQuery.java:130)
at org.basex.core.cmd.XQuery.run(XQuery.java:22)
at org.basex.core.Command.run(Command.java:257)
at org.basex.core.Command.execute(Command.java:93)
at org.basex.gui.GUI.exec(GUI.java:416)
at org.basex.gui.GUI.lambda$execute$4(GUI.java:359)
at java.base/java.lang.Thread.run(Thread.java:834)