retnuh/mochiweb_xpath — pull request #3 by anneli (2011-11-21 01:33:13+00:00)
Title: Add support for concat(), contains() XPath functions.

This commit adds support for the `concat()` and `contains()` XPath functions, as well as a test demonstrating their most common use case (`//div[contains(concat(' ', @class, ' '), ' blah ')]`).

Note that the `xmerl_xpath_scan` has a bug; it fails to tokenise `(' ', @class, ' ')` (or `(' ', attribute::class, ' ')`), so the test works around it by wrapping `@class` in parens. I'll probably try to fix that next, but that's a longer process.

In the mean time, these functions can be enjoyed by all.