Hi Martin,
In BaseX, all queries are XQuery expressions. As a consequence, ampersands must always be escaped:
//File[@originalLocation='E:\data\bugs\prom-9366\file & codemodel']/CopiedLocations/CopiedLocation
In more recent versions of BaseX (...later than 7.9...), you can take advantage of the XQuery 3.1 string constructor [1]:
//File[@originalLocation=``[E:\data\bugs\prom-9366\file & codemodel]``]/CopiedLocations/CopiedLocation
If we use JDOM Nodes the query does not fail in this case.
Why JDom can execute this query and BaseX cannot?
I know too less about JDom, but I assume that it only provides support for basic XPath 1.0 expressions?
Cheers, Christian
[1] http://docs.basex.org/wiki/XQuery_3.1#String_Constructor