Hi, everyone. I've been searching around for a
simple XPath expression validator, just to check that the XPaths we
hand-write are really valid. lxml looks like it might do well at this.
However, I did find a case where an invalid expression doesn't throw:
[ajvincent@localhost ~]$ python
Python 2.7.8 (default, Nov 10 2014, 08:19:18)
[GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
>>> etree.XPath("//b[contains(.)]")
//b[contains(.)]
The contains function, as I understand it, takes exactly two arguments.