[Lxml-checkins] r44170 - in lxml/branch/lxml-1.3: . src/lxml

scoder at codespeak.net scoder at codespeak.net
Tue Jun 12 18:01:00 CEST 2007


Author: scoder
Date: Tue Jun 12 18:00:59 2007
New Revision: 44170

Modified:
   lxml/branch/lxml-1.3/TODO.txt
   lxml/branch/lxml-1.3/src/lxml/extensions.pxi
   lxml/branch/lxml-1.3/src/lxml/parser.pxi
   lxml/branch/lxml-1.3/src/lxml/xpath.pxi
   lxml/branch/lxml-1.3/src/lxml/xslt.pxi
Log:
merged in revs 39788:40177 from trunk

Modified: lxml/branch/lxml-1.3/TODO.txt
==============================================================================
--- lxml/branch/lxml-1.3/TODO.txt	(original)
+++ lxml/branch/lxml-1.3/TODO.txt	Tue Jun 12 18:00:59 2007
@@ -41,5 +41,5 @@
 Features
 --------
 
-* Relaxed NG compact notation (rnc versus rng) support.  Currently not
-  supported by libxml2 (patch exists)
+* RelaxNG compact notation (rnc versus rng) support.  Currently not supported
+  by libxml2 (patch exists)

Modified: lxml/branch/lxml-1.3/src/lxml/extensions.pxi
==============================================================================
--- lxml/branch/lxml-1.3/src/lxml/extensions.pxi	(original)
+++ lxml/branch/lxml-1.3/src/lxml/extensions.pxi	Tue Jun 12 18:00:59 2007
@@ -102,16 +102,16 @@
 
     # namespaces (internal UTF-8 methods with leading '_')
 
-    def addNamespace(self, prefix, uri):
+    cdef addNamespace(self, prefix, uri):
         if self._namespaces is None:
             self._namespaces = {}
         python.PyDict_SetItem(self._namespaces, prefix, uri)
 
-    def registerNamespaces(self, namespaces):
+    cdef registerNamespaces(self, namespaces):
         for prefix, uri in namespaces.items():
             self.registerNamespace(prefix, uri)
     
-    def registerNamespace(self, prefix, ns_uri):
+    cdef registerNamespace(self, prefix, ns_uri):
         prefix_utf = self._to_utf(prefix)
         ns_uri_utf = self._to_utf(ns_uri)
         xpath.xmlXPathRegisterNs(self._xpathCtxt, prefix_utf, ns_uri_utf)
@@ -238,12 +238,14 @@
 cdef xpath.xmlXPathFunction _function_check(void* ctxt,
                                             char* c_name, char* c_ns_uri):
     "Module level lookup function for XPath/XSLT functions"
+    cdef xpath.xmlXPathFunction c_func
     cdef _BaseContext context
     context = <_BaseContext>ctxt
     if context._prepare_function_call(c_ns_uri, c_name):
-        return _call_prepared_function
+        c_func = _call_prepared_function
     else:
-        return NULL
+        c_func = NULL
+    return c_func
 
 cdef xpath.xmlXPathObject* _wrapXPathObject(object obj) except NULL:
     cdef xpath.xmlNodeSet* resultSet
@@ -358,7 +360,6 @@
 
 cdef void _extension_function_call(_BaseContext context, function,
                                    xpath.xmlXPathParserContext* ctxt, int nargs):
-    cdef _Element node
     cdef _Document doc
     cdef xpath.xmlXPathObject* obj
     cdef int i

Modified: lxml/branch/lxml-1.3/src/lxml/parser.pxi
==============================================================================
--- lxml/branch/lxml-1.3/src/lxml/parser.pxi	(original)
+++ lxml/branch/lxml-1.3/src/lxml/parser.pxi	Tue Jun 12 18:00:59 2007
@@ -406,7 +406,7 @@
             if pctxt.spaceTab is not NULL: # work around bug in libxml2
                 xmlparser.xmlClearParserCtxt(pctxt)
 
-    cdef int _lockParser(self) except 1:
+    cdef int _lockParser(self) except -1:
         cdef python.PyThreadState* state
         cdef int result
         if config.ENABLE_THREADING and self._parser_lock != NULL:

Modified: lxml/branch/lxml-1.3/src/lxml/xpath.pxi
==============================================================================
--- lxml/branch/lxml-1.3/src/lxml/xpath.pxi	(original)
+++ lxml/branch/lxml-1.3/src/lxml/xpath.pxi	Tue Jun 12 18:00:59 2007
@@ -143,9 +143,8 @@
     def registerNamespaces(self, namespaces):
         """Register a prefix -> uri dict.
         """
-        add = self._context.addNamespace
         for prefix, uri in namespaces.items():
-            add(prefix, uri)
+            self._context.addNamespace(prefix, uri)
 
     def __call__(self, _path, **_variables):
         """Evaluate an XPath expression on the document.

Modified: lxml/branch/lxml-1.3/src/lxml/xslt.pxi
==============================================================================
--- lxml/branch/lxml-1.3/src/lxml/xslt.pxi	(original)
+++ lxml/branch/lxml-1.3/src/lxml/xslt.pxi	Tue Jun 12 18:00:59 2007
@@ -1,4 +1,4 @@
-# XSLT and XPath classes, supports for extension functions
+# XSLT
 
 cimport xslt
 
@@ -265,6 +265,15 @@
 
 cdef class XSLT:
     """Turn a document into an XSLT object.
+
+    Keyword arguments of the constructor:
+    * regexp - enable exslt regular expression support in XPath (default: True)
+    * access_control - access restrictions for network or file system
+
+    Keyword arguments of the XSLT run:
+    * profile_run - enable XSLT profiling
+
+    Other keyword arguments are passed to the stylesheet.
     """
     cdef _XSLTContext _context
     cdef xslt.xsltStylesheet* _c_style
@@ -415,6 +424,7 @@
         if params is not NULL:
             # deallocate space for parameters
             python.PyMem_Free(params)
+            keep_ref = None
 
         if transform_ctxt.profile:
             c_profile_doc = xslt.xsltGetProfileInformation(transform_ctxt)


More information about the lxml-checkins mailing list