可以在LXML中注册的XPath 2函数集
lxml-xpath2-functions的Python项目详细描述
更改日志
- 0.0.4:
- 添加了一个降低文本的新函数(mathieu leduc hamel)。
- 0.0.3:
- 已定义默认前缀“xp2f”。
- 0.0.2:
- 已更改默认命名空间。
- 0.0.1:
- 添加了函数:字符串连接。
支架
- 环境:python 2.6、python2.7、python 3.2、python3.3、python3.4、pypypy
说明
一组xpath2函数,可以在lxml中注册。用户注册所有或选定的函数 在自己的xpath中使用它们。xpath可在默认命名空间下访问: http://kjw.pt/xpath2-functions或空命名空间(如果需要)。
用法
示例:
from lxml import etree import xpath2_functions # registering all available functions in default namespace xpath2_functions.register_functions(etree) # registering chosen functions in the empty namespace xpath2_functions.register_functions(etree, ns=None, functions=['string-join'])
功能
- string join(arg1为xs:string,arg2为xs:string)-返回arg1 通过使用$arg2连接$arg1序列的成员创建 分隔符。如果$arg2的值是零长度字符串,则成员 $arg1的连接没有分隔符。
- 小写(arg1 asxs:string)-返回已转换为小写的arg1 字符串。
贡献者
- 卡米尔库亚温斯基
- mathieu leduc hamel(xpath函数:小写)