XPathExpression xp = xpfac.compile("//*[text()='?' OR text()='']", Filters.element(), null, namespaces);
throws this exception:
org.jaxen.XPathSyntaxException: Expected: ]
I'm not sure if this syntax is allowed. It just works in firepath.
Couple of things. Firstly, this is a Jaxen issue ;-)
Secondly, Jaxen (and I believe XPath in general) is case sensitive to the 'or' expression. For your XPath to work you need to change the case of 'OR' to 'or'. 'or' is an operator.