Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Set of Xpath 2.0 functions which you can register in lxml

Project Description


  • 0.0.4:
    • Added a new function for lowering text (Mathieu Leduc-Hamel).
  • 0.0.3:
    • Defined default prefix ‘xp2f’.
  • 0.0.2:
    • Changed default namespace.
  • 0.0.1:
    • Added function: string-join.


  • Environments: Python 2.6, Python 2.7, Python 3.2, Python 3.3, Python 3.4, PyPy


Set of Xpath2 functions which you can register in lxml. User register all or chosen functions and use them in own xpaths. Xpaths are accessible under default namespace: or empty namespace if needed.



from lxml import etree
import xpath2_functions

# registering all available functions in default namespace

# registering chosen functions in the empty namespace
xpath2_functions.register_functions(etree, ns=None, functions=['string-join'])


  • string-join (arg1 as xs:string, arg2 as xs:string) - returns an arg1 created by concatenating the members of the $arg1 sequence using $arg2 as a separator. If the value of $arg2 is the zero-length string, then the members of $arg1 are concatenated without a separator.
  • lower-case (arg1 as xs:string) - returns an arg1 converted to lower-cased string.


  • Kamil Kujawinski
  • Mathieu Leduc-Hamel (xpath functions: lower-case)

Release History

This version
History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(5.5 kB) Copy SHA256 Hash SHA256
Source None Feb 13, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting