Hi,
Given this XML document (in file example.xml):
<p xmlns="http://example.com/one" xml:lang="de" author="Friedrich von Schiller"> Freude, schöner Götterfunken,<br/> Tochter aus Elysium,<br/> Wir betreten feuertrunken,<br/> Himmlische, dein Heiligtum.</p>
This XQuery expression (in file TesQNametExpression.xquery, in the same directory):
let $doc := doc('example.xml') return string-length($doc/Q{ http://example.com/one%7Dp%5B1%5D/@Q%7Bhttp://www.w3.org/XML/1998/namespace%...)
produces:
0
However the correct result (which I get with Saxon 9.5.01) is:
1
Here is the "Query Info" from the BaseX UI:
Compiling: - pre-evaluating fn:doc("example.xml") - binding static variable $doc - removing unknown element/attribute Q{http://example.com/one%7Dp - pre-evaluating fn:string-length(()) - removing variable $doc - simplifying flwor expression Query: let $doc := doc('example.xml') return string-length($doc/Q{ http://example.com/one%7Dp%5B1%5D/@Q%7Bhttp://www.w3.org/XML/1998/namespace%...) Optimized Query: 0
Hope that this information would be useful for identifying and fixing the issue.