[Lxml-checkins] r43529 - lxml/trunk/doc
scoder at codespeak.net
scoder at codespeak.net
Mon May 21 18:00:00 CEST 2007
Author: scoder
Date: Mon May 21 17:59:54 2007
New Revision: 43529
Modified:
lxml/trunk/doc/xpathxslt.txt
Log:
doc: make clear regexp support is the default
Modified: lxml/trunk/doc/xpathxslt.txt
==============================================================================
--- lxml/trunk/doc/xpathxslt.txt (original)
+++ lxml/trunk/doc/xpathxslt.txt Mon May 21 17:59:54 2007
@@ -199,12 +199,11 @@
>>> print find(root)[0].tag
{NS}b
-You can pass the boolean keyword ``regexp`` to enable Python regular
-expressions in the EXSLT_ namespace::
+By default, ``XPath`` supports regular expressions in the EXSLT_ namespace::
>>> regexpNS = "http://exslt.org/regular-expressions"
- >>> find = etree.XPath("//*[r:test(., '^abc$', 'i')]",
- ... {'r':regexpNS}, regexp = True)
+ >>> find = etree.XPath("//*[re:test(., '^abc$', 'i')]",
+ ... {'re':regexpNS})
>>> root = etree.XML("<root><a>aB</a><b>aBc</b></root>")
>>> print find(root)[0].text
@@ -212,6 +211,9 @@
.. _EXSLT: http://www.exslt.org/
+You can disable this with the boolean keyword argument ``regexp`` which
+defaults to True.
+
The ``XPathEvaluator`` classes
------------------------------
More information about the lxml-checkins
mailing list