Improve selector_to_xpath tests on pseudo-elements
... rather than rejecting them. Fix Kozea/WeasyPrint#128
Fix tox.ini for Python 2.5
Fix exception message in functional pseudo-element test example
Travis-CI config: remove Python 3.1, add Python 3.3
Python 3.1 not supported anymore in Travis http://about.travis-ci.org/docs/user/ci-environment/#Python-VM-images
Let extended translators override what XPathExpr class is used
GenericTranslator offers an excelent way to support custom selectors trough method hooks and allowing to return a *new* XPathExpr from this hooks. The main problem is that returning extended `XPathExpr` instances fail for combiners because `XPathExpr.join()` assume a fixed XPathExpr instance attributes (element, path and condition) to copy from `other` to `self` `XPathExpr.join()` can be extended in subclass but needs that `left` xpath instance to be of the extended class too, and right now we can only control `right` xpath type. The problem can be mitigated by recasting all xpath returned from `GenericTranslator.xpath_element()` that only works because it is the only hook that cast `XPathExpr` instances. The proposed change allow projects extending GenericTranslator to also safely extend `XPathExpr` to correctly support combiners in extended features.
Have :empty not match whitespace-only elements.
Whitespace is *not* empty.
Use lang() for XML docs
Make sure that getattr() with a default does not raise an UnicodeError or a TypeError on either Py2 or 3. Instead, all non-ASCII pseudo-classes are invalid selectors (as an inexistant pseudo-class should.)