ligasgr / intellij-xquery

Plugin to support XQuery in Intellij Idea
Apache License 2.0
35 stars 23 forks source link

Incorrect error using ancestor::node in XPath #133

Closed rhdunn closed 8 years ago

rhdunn commented 8 years ago

Given the XPath:

($foo//bar/ancestor::node)[1]

the error message:

'(' expected, got ')'

is displayed. This is incorrect, as the construct is valid. It looks like the syntax is trying to validate structures like node().

ligasgr commented 8 years ago

is the ancestor::node here pointing to an /ancestor with an element with name 'node'? Something like this?

let $foo := <x><node><bar></bar></node></x>
return ($foo//bar/ancestor::node)[1]

It shouldn't be treated as an error, I agree.

rhdunn commented 8 years ago

That is correct, yes.