With xquery:parse(), I wondered about this myself, so I second this question 
without having an answer :-(

You will get a query plan if it is a non-static error:

xquery:parse("let $a := <B></B> return $a + 1", map 
{'compile':true(),'pass':true()})

… but what the pass option does is not clear to me. Definitely not passing the 
type error here.

If you only need to catch the error message without the query plan, there’s 
always try/catch of course.

Best, Daniel

Von: Peter Villadsen <peter.villad...@microsoft.com>
Gesendet: Mittwoch, 13. November 2019 00:36
An: basex-talk@mailman.uni-konstanz.de
Betreff: [basex-talk] Is there an API that provides XQuery compilation results?

When I use the GUI application I can see some error description (even if it a 
little terse) when my queries are incorrect. For instance I might get:

Stopped at tableFields.xq, 27/50:
[XQST0118] Different start and end tag: <Artifact>...</Artiact>.

If I submit a query like <Artifact></Artiact>

However, I cannot seem to find an API that brings me that information? I tried:

xquery:parse("<B></C>", map {'pass':true()})

but that did not get the result I expected.  Also, while we’re at at it, it 
would be nice to also get the optimized query.


Best Regards

Peter Villadsen
Principal Architect
Microsoft Business Applications Group

Reply via email to