[Lxml-checkins] r43533 - in lxml/trunk: . src/lxml

scoder at codespeak.net scoder at codespeak.net
Mon May 21 18:02:08 CEST 2007


Author: scoder
Date: Mon May 21 18:02:07 2007
New Revision: 43533

Modified:
   lxml/trunk/CHANGES.txt
   lxml/trunk/src/lxml/xpath.pxi
Log:
ETXPath was missing regexp keyword

Modified: lxml/trunk/CHANGES.txt
==============================================================================
--- lxml/trunk/CHANGES.txt	(original)
+++ lxml/trunk/CHANGES.txt	Mon May 21 18:02:07 2007
@@ -44,6 +44,8 @@
 Bugs fixed
 ----------
 
+* ``ETXPath`` was missing the ``regexp`` keyword argument
+
 * passing '' as XPath namespace prefix did not raise an error
 
 * passing '' as namespace prefix in nsmap could be passed through to libxml2

Modified: lxml/trunk/src/lxml/xpath.pxi
==============================================================================
--- lxml/trunk/src/lxml/xpath.pxi	(original)
+++ lxml/trunk/src/lxml/xpath.pxi	Mon May 21 18:02:07 2007
@@ -407,10 +407,14 @@
 
 cdef class ETXPath(XPath):
     """Special XPath class that supports the ElementTree {uri} notation for
-    namespaces."""
-    def __init__(self, path, extensions=None):
+    namespaces.
+
+    Note that this class does not accept the ``namespace`` keyword
+    argument. All namespaces must be passed as part of the path string.
+    """
+    def __init__(self, path, extensions=None, regexp=True):
         path, namespaces = self._nsextract_path(path)
-        XPath.__init__(self, path, namespaces, extensions)
+        XPath.__init__(self, path, namespaces, extensions, regexp)
 
     cdef _nsextract_path(self, path):
         # replace {namespaces} by new prefixes
@@ -422,7 +426,7 @@
         i = 1
         for namespace_def in _find_namespaces(stripped_path):
             if namespace_def not in namespace_defs:
-                prefix = python.PyString_FromFormat("xpp%02d", i)
+                prefix = python.PyString_FromFormat("__xpp%02d", i)
                 i = i+1
                 python.PyList_Append(namespace_defs, namespace_def)
                 namespace = namespace_def[1:-1] # remove '{}'


More information about the lxml-checkins mailing list