the following query
for
$hit in //*[./name() ="p"]
return
<out >{$hit}</out>
leads to
Improper
use? Potential bug? Your feedback is welcome:
Contact: basex-talk@mailman.uni-konstanz.de
Version: BaseX 9.2
Java: Oracle Corporation, 10
OS: Windows 7, amd64
Stack Trace:
java.lang.NullPointerException
at org.basex.query.expr.SimpleMap.get(SimpleMap.java:43)
at org.basex.query.expr.path.Path.optimize(Path.java:202)
at org.basex.query.expr.path.Path.compile(Path.java:153)
at org.basex.query.expr.Arr.compile(Arr.java:42)
at org.basex.query.expr.Preds.compile(Preds.java:46)
at org.basex.query.expr.path.Step.compile(Step.java:95)
at org.basex.query.expr.path.Path.compile(Path.java:142)
at
org.basex.query.expr.gflwor.ForLet.compile(ForLet.java:43)
at
org.basex.query.expr.gflwor.GFLWOR.compile(GFLWOR.java:88)
at org.basex.query.scope.MainModule.comp(MainModule.java:81)
at
org.basex.query.QueryCompiler.compile(QueryCompiler.java:114)
at
org.basex.query.QueryCompiler.compile(QueryCompiler.java:105)
at
org.basex.query.QueryContext.compile(QueryContext.java:312)
at
org.basex.query.QueryProcessor.compile(QueryProcessor.java:79)
at org.basex.core.cmd.AQuery.query(AQuery.java:93)
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:422)
at org.basex.gui.GUI.lambda$execute$4(GUI.java:365)
at java.base/java.lang.Thread.run(Unknown Source)
Compiling:
- pre-evaluate root to document-node() sequence: root() ->
(db:open-pre("publication-toc", 0), ...)
Optimized Query:
for $hit_0 in (db:open-pre("publication-toc", 0),
...)/descendant-or-self::node()/*[(name() = "p")] return element
out { ($hit_0) }
Query:
for $hit in //*[./name() ="p"] return <out
>{$hit}</out>
might be some side effect from latest improvements?
Alex