BaseXdb/basex — Issue #291: XPath: String Comparision and XPath Compatibility
Author: prsebastian
Created: 2011-11-29 22:21:58+00:00
State: open

Dear BaseX Team,

I'm accustomed from XPath 1.0/2.0 to filter nodes by comparing their text() content in a selection predicate like
//*[contains(text(), 'some text')] or //*[starts-with(text(), 'some text')]. While this works for attributes, it does not work for text() in BaseX.

You can head over to http://basex.org/products/live-demo/ and try doc('xmark')//*[contains(text(),"Personal")] and you'll see
the error message "No sequence text() allowed."

I've learned that one can alternatively use //*[text() contains text "Personal"] and that works fine, but I get my XPath expressions created from a black box library and they contain the other XPath predicates.

So, is this a bug or an XQuery policy that is preferred over XPath ?

Regards, Sebastian